美文网首页
小程序 scroll-view 与 position: fixe

小程序 scroll-view 与 position: fixe

作者: IT_IOS_MAN | 来源:发表于2022-11-10 17:13 被阅读0次

wxml

<scroll-view>

  <view class="item-wrap">
    //...
  </view>

</scroll-view>

wcss

.item-wrap {
  position: fixed; // /* 转化为 position: absolute */
} 

注:在 scroll-view 子组件使用 position: fixed 不会生效。scroll-view 会将 position: fixed 转化为 position: absolute

相关文章

网友评论

      本文标题:小程序 scroll-view 与 position: fixe

      本文链接:https://www.haomeiwen.com/subject/jxqtxdtx.html