scroll-view父级cover-view且外层fixed滚动时scroll-view无法固定?
要实现顶部fixed,最外层cover-view 固定在顶部,内层用scroll-view左右滚动。
问题:页面上下滚动时,scroll-view也一起上下滚动了。
代码:
<cover-view class="tab-bar">
<scroll-view scroll-x="true" enhanced="true" enable-flex="{{true}}" using-sticky="{{true}}" show-scrollbar="{{true}}" scroll-with-animation="{{true}}" class="scroll-view">
<cover-view class="tab-box">
<cover-view class="tab {{day == item.day ? 'active' : ''}}" wx:for="{{dayList}}" wx:key="date" wx:for-index="idx" wx:for-item="item" bindtap="tabsChange" data-value="{{item.day}}">
<cover-view class="tab-name">{{item.date}}</cover-view>
<cover-view class="tab-label">{{item.week}}</cover-view>
<cover-view class="tab-label"">{{item.tide_size}}</cover-view>
</cover-view>
</cover-view>
</scroll-view>
</cover-view>
样式:
.tab-bar{position: fixed;left: 0;right: 0;z-index: 99;background-color: #0052D9;height: 54px;}
.tab-box{width: 1500rpx;display: flex;align-items: flex-start;justify-content: flex-start;}
.tab-bar .tab{padding: 6rpx 4rpx 10rpx;margin-right:2rpx;color: #fff;border-radius: 6rpx;
text-align: center;
width: 90rpx;
}
.tab-bar .tab .tab-name{text-align: center;font-size: 28rpx;}
.tab-bar .tab .tab-label{font-size: 20rpx;text-align: center;}
.tab-bar .tab.active{background-color: #1A71FF;}
canvas也支持同层渲染了,view也能挡住canvas。以真机为准,模拟器模拟的canvas和真机不一样
<cover-view>这个里面,不是只能嵌套<cover-view>或者<cover-image>吗