部分机型fit-content无法正常显示
width: fit-content 部分机型不能正常使用(iPhone 5S, iOS 10.3.3)
效果图如下
iPhone 5S: https://ws2.sinaimg.cn/large/006tNc79ly1fostfmm11pj30gy0u0abs.jpg
其他: https://ws3.sinaimg.cn/large/006tNc79ly1fostf0n45pj30gy0u0abs.jpg
< view class = "indicator-container" wx:if="{{imageLength > 1}}"> < view class = "indicators" > < block wx:for = "{{images}}" wx:key = "index" > < view class = "indicator {{(currentIndex === index)?'active':''}} {{(index !== 0)?'margin-left-enable':''}}" ></ view > </ block > < view style = "clear: both" ></ view > </ view > </ view > |
.indicator-container { position : absolute ; bottom : 35 rpx; width : 100% ; height : 10 rpx; } .indicators { width : fit-content; margin : auto ; } .indicator { float : left ; height : 10 rpx; width : 10 rpx; background-color : rgb ( 230 , 230 , 230 ); } .active { background-color : black ; width : 38 rpx; } .margin-left-enable { margin-left : 22 rpx; } |