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; } |
添加box-sizing: content-box;虽然这个属性是默认属性,但是上面的那个机型,只有加了这个属性width: fit-content;属性就会生效
fit-content 对于ios部分机型本身就有兼容性问题。经测在iPhone 11机器上也会表现出来。跟微信内核、小程序基础库没有关系。
请问有人没,急求