对cover-view 和 cover-image, 在同一级中设置 position:absolute, 在ios真机中z-index是无效的
比如:
<cover-view class=“rob-mid-bg”>cover1</cover-view>
<cover-view class=“rob-last-bg”>cover2</cover-view>
.rob-mid-bg{
position: absolute;
z-index: 50;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 159rpx;
height: 159rpx;
background-color:#ff9a00;
border-radius: 9999rpx;
animation: showornot 2s linear 0s infinite;
}
.rob-last-bg{
position: absolute;
z-index: 10;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 180rpx;
height: 180rpx;
background-color: #78694e;
border-radius: 9999rpx;
transform-origin: center;
animation: showornot 1.5s linear 0s infinite;
}
以上代码 ,在模拟器和安卓机中都是好的,但 在ios真机中,cover1永远被cover2覆盖,除非把cover1放到cove2下面,才能覆盖cover2
<cover-view class=“rob-last-bg”>cover2</cover-view>
<cover-view class=“rob-mid-bg”>cover1</cover-view>
之前也发过一个cover-view的问题,一直没有回复… 现在又发现一个