一、z-index 第一反应肯定是用z-index来提升按钮的层级和降低canvas的层级,显然意料之中的失效,因为canvas等一些原生组件层级很高。 二、cover-view 然后想到的是cover-view 但是使用后发现它并不能固定在屏幕右下角,后来发现uniapp的cover-view不支持下面的css 三、canvasToTempFilePath 这是在社区找到的方法,也是...
this.canvasInstance = uni.createCanvasContext( "clip-canvas", this ); this.canvasInstance.drawImage( res.tempFilePath, -data.left, -data.top, this.systemInfo.screenWidth, this.screenHeight, 0, 0 ); this.canvasInstance.draw( false, (() => { setTimeout(() => { uni.canvasToTempFilePat...
<canvasclass="rotatCanvas"id="rotatCanvas":style="{ 'z-index': -1, width: `${screenWidth}px`, height: `${(screenWidth * screenWidth) / screenHeight}px` }"canvas-id="rotatCanvas"></canvas> <viewclass="button-line"> <viewclass="save-button"@tap.stop="finish">保存</view> <vi...
方案二是uni.canvasToTempfilepath()将视图转换为图片,显示隐藏; 针对我的项目来说,方案二可行. 我的代码如下: <template> <view> <view class="content"> <!-- @indexState="indexState"这个就是我接收下拉点击时传过来的方法和参数名 --> <sl-filter :themeColor="themeColor" :menuList="menuList" @...
z-index: 99; align-items: center; justify-content: center; } } } </style> 2.水印图片绘制 图片水印返回上一页用<canvas>添加水印 <template> <view class="page"> <view style="height: 80rpx;"></view> <navigator class="buttons" url="../camera/camera"><button type="primary">打开自定义...
class="canvasArea" :style="{ height: colorHeights + 'px', zIndex: 999, }" > <view> <canvas @tap="tapCanvas" :style="{ width: colorWidths + 'px', height: colorHeights + 'px', }" canvas-id="myCanvas" id="myCanvas"
class="canvasArea" :style="{ height: colorHeights + 'px', zIndex: 999, }" > <view> <canvas @tap="tapCanvas" :style="{ width: colorWidths + 'px', height: colorHeights + 'px', }" canvas-id="myCanvas" id="myCanvas" ></canvas> </view> </view> <view class="colorItem"> ...
showCanvas = false; this.clear(); }, //创建并显示画布 createCanvas: function() { this.showCanvas = true; this.ctx = uni.createCanvasContext("mycanvas", this); //创建绘图对象 //设置画笔样式 this.ctx.lineWidth = 4; this.ctx.lineCap = "round"; this.ctx.lineJoin = "round"; }, /...
renderer: L.canvas({ padding: 1 }) //解决遮罩层拖拽与缩放显示不全的Bug }); //建立多边形覆盖物 ahLayer.addTo(this.map); }, //属性psArr变化监控 updatePsArr(newValue, oldValue, ownerInstance, instance) { console.log(newValue,'newValue'); ...
✓ 已被采纳 使用cover-view 呗,然后再给 cover-view 和canvas 设置一下 z-index 的层级就好了。 有用1 回复 撰写回答 你尚未登录,登录后可以 和开发者交流问题的细节 关注并接收问题和回答的更新提醒 参与内容的编辑和改进,让解决方法与时俱进 注册登录...