cover-view在canvas上的样式失调
发布于 5 年前 作者 taoxiong 16035 次浏览 来自 问答

初衷是想做一个定位在右上角的小叉,用来关闭canvas,在ios上出现了样式失调,安卓没问题

wxml:

<view class=‘canvasCon’ style=“width:670rpx;height:850rpx” catchtap=‘closecanvas2’>

    <canvas canvas-id=“myCanvas” class=“canvas”>

        <cover-view bindtap=‘closecanvas’ class=“canvasView”>

            <cover-image class=“canvasImg” src=https://cms.hylpz.cn/data/images/common/close.png/>

        </cover-view>

    </canvas>

    <view class=“canvasButton” catchtap=‘canvasToTempFilePath’>保存图片</view>

</view>

wxss:

.page .canvasBox .canvasCon{

    top: 50%;

    left: 50%;

    margin-left: -335rpx;

    margin-top: -500rpx;

    position: relative;

    border-radius: 20rpx;

    z-index: 999;

    background: #fff;

}

.page .canvasBox .canvasCon .canvas{

    width: 100%;

    height: 100%;

    overflow: hidden;

    border-radius: 20rpx;

}

.page .canvasBox .canvasCon .canvas .canvasView{

    display: block;

    width: 44rpx;

    height: 44rpx;

    position: absolute;

    top:20rpx;

    right: 20rpx;

    z-index: 1000;

}

安卓展示:

ios展示:

请问这是什么原因,或是小程序的bug?

回到顶部