请问怎么实现右下角的图标距离底部122rpx 一直悬浮在右边。使用的flex布局,我这样写不生效呢。
我的代码如下:
<view class="flex_column"> //最外层view
<view class="rightFlot">
<view class="barrage background-feef88">
<image src="../../static/img/barrage.png"></image>
</view>
</view>
</view>
.flex_column{
flex-direction: column;
.rightFlot{
justify-content: flex-end;
.barrage{
width: 106upx;
height: 106upx;
justify-content: center;
border-radius: 50%;
line-height: 106upx;
display: fixed;
bottom: 122upx;
right:0;
z-index: 999;
image{
width: 70upx;
height: 40upx;
margin-top:33rpx;
}
}
}
}
楼上说的对,用position很简单的.
我看你代码中有z-index、以及调整位置的right、bottom等属性,这些属性在不设置position属性(设为relative,absolute,fixed)的时候是不生效的。