ios 动态显示的button css样式失效absolute bg等
absolute的问题:wx:if动态显示cover-view,class样式的设置为absolute,但是有时候left,right,top,bottom没有生效,默认显示在左上角0 * 0;如下图正常如下:
有时候样式会不生效,就对定位元素出现在左上角:
相关代码:
wxml:
<button wx:if="{{inputShow === false && load === true }}" open-type="share" class="shareBtn"> <cover-image class="share" src="/assets/img/share.png"></cover-image>
<block wx:if="{{token === false && canIUse && load === true }}">
<cover-image style="width: 100%;height: 100%" src="/assets/img/gift.png"></cover-image> </button>
<cover-image style="width: 100%;height: 100%" src="/assets/img/live_say.png" class="share"> </cover-image> </button></block> |
wxss:
.giftBtnCont { position: absolute; right: 16rpx; bottom: 10rpx; width: 84rpx; height: 84rpx; padding-left: 0; padding-right: 0; background-color: transparent;}.sendBtn { position: absolute; left: 16rpx; bottom: 10rpx; width: 84rpx; height: 84rpx; background: transparent;}.shareBtn { position: absolute; right: 115rpx; bottom: 10rpx; width: 84rpx; height: 84rpx; padding-left: 0; padding-right: 0; background-color: transparent;} |
background的问题:
一个flex cover-view盒子,左边是固定宽高动态添加src的cover-image,中间是不定长文字,右边是动态加载固定宽高的元素,给盒子加上有透明度的background,ios中只会给文字加上背景,图片和动态加载的元素不会显示背景。显示上来看,cover-image没加载src的时候宽高没没起作用。
希望这些问题官方能重视
