<canvas
id="lipCanvas"
canvas-id="lipCanvas"
class="lipCanvas"
disable-scroll="{{true}}"
style="width: 100%; height: 100%;background-image: url('{{photoSrc}}'); background-repeat:no-repeat;background-size:contain;-moz-background-size:contain;background-position-x:center;background-position-y: center">
</canvas>
其他机型都能显示出来这个画布上的背景图片,不知道iphone为什么不显示,请问有解决办法吗
其他方法就是 canvas 用2d,然后image设置absolute定位 ,z-index大于0
<view class="canvas-box"> <canvas type="2d" /> <image src="xxx" class="poster" /> </view> .canvas-box { width: 600rpx; height: 400rpx; position: relative; overflow: hidden; } .poster { width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 99; }
https://developers.weixin.qq.com/s/16YiogmQ7Uvj
同问,求解