c..._view absolute 怎么覆盖scroll-view">
当前位置:   article > 正文

小程序如何实现其他内容覆盖scroll-view层呢?已解决_view absolute 怎么覆盖scroll-view

view absolute 怎么覆盖scroll-view

在这里插入图片描述
如果你想要实现的效果如上图所示,那么可以参考一下的代码:思路主要是因为scroll-view的层级太高了,所以我们用两个scroll-view来处理这种问题。

wxml

<view style="width:100%;height:100rpx;background:orange;text-ailgn:center;" bindtap="change"><text>click me</text>
</view>
<scroll-view style="overflow:hidden;background:yellow;" scroll-y="true" wx:if="{
  {show}}">
  <view wx:for="{
  {2}}">
    <view style="margin:20rpx;border:1rpx solid #000;background:pink;color:white;padding:30rpx;">各种菜单项{
  {index+10}}</view>
  </view>
</scroll-view>
<scroll-view style="height:900rpx;background:transparent;position:fixed;top:100rpx;z-index:-1" scroll-y="true" >
  <view wx:for="{
  {10}}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签