[微信小程序]margin-bottom在<scroll-view>中失效 [居然都失效了,这不正常。]

该Bug仅出现在iOS平台:

margin-bottom在<scroll-view>中失效

代码片段:

//index.wxml

<scroll-view id="scroll" scroll-y="true">
    <view id="view"></view>
</scroll-view>

//index.wxss

#scroll{
    height: 800rpx;
    background: yellow;
}
#view{
    height: 1000rpx;
    background: green;
     
    margin-bottom: 300rpx;
}

----------------------------------------------------------------------------------------------

安卓平台表现正常


该Bug仅出现在iOS平台:

margin-bottom在<scroll-view>中失效


  • iOS里会自动隐藏最底部的margin-bottom哦~, 藏得好深,根本找不到!
    • 所以你的意思这是Feature而非Bug?, 好难选呀。
    • 嗯 iOS上的特性。。你可以写个简单的页面在 safari上试试,也是margin-bottom无效的。换种实现方式吧, 好的