canvas 层级设置
发布于 6 年前 作者 ykang 629 次浏览 来自 问答

模拟器上canvas显示正常,不会覆盖footer内容

真机上,如图,canvas会覆盖footer

这种有办法解决吗?

<canvas canvas-id='canvas' class='canvas' style="z-index:-1;position:relative;"></canvas>
底部
.mainFooter{
position: fixed;
bottom: 0;
display: flex;
height: 45px;
justify-content: space-around;
align-items: center;
flex: auto;
background: #fff;
border-top: 1px solid #e5e5e5;
width: 100%;
z-index: 9999;
}
<view class='mainFooter'>
<view  class='footerLeft' bindtap='baoMingDialog' data-type="2">
    <text>看房服务</text><text class="fon12">免费专车接送</text>
  </view>
  <view class="footerRight" bindtap='callMobile'>
    <text>致电售楼处</text><text class="fon12">保护你的真实号码</text>
  </view>
</view>
4 回复

使用cover-view组件

加个 type=“2d” 看下呢?然后下面footer的的z-index设置高点。

应该用canvas的同层渲染把 2d那个

回到顶部