<view class="page" style="height:100%;margin: 0;">
<view class="top_header">
<view class="header" :class="{header_fixed: fixedHeader}">
<view class="input-view" @tap="onSearch">
<uni-icon type="search" size="18" color="#666"></uni-icon>
<input class="input" type="text" placeholder="搜索你想购买的商品" disabled="true"/>
</view>
</view>
</view>
<view style="height: 30000upx;background-color: #000;"></view>
</view>
.top_header {
position: fixed;
width: 750upx;
top: 0;
z-index: 100;
-webkit-transform: translateZ(0);
transform: translateZ(0);
}
.header {
z-index: 100;
display: flex;
flex-direction: row;
align-items: center;
padding: 8px 15px;
}
.header_fixed {
background-color: #F8F8F8;
}
uni.pageScrollTo({scrollTop: 48, duration:400});
3***@qq.com
我测试的时候也发现这个问题,如果 外层view 设置 fixed,内层view 也有 fixed或者absolute,滚动时就会抖动,但如果只有外层view设置 fixed ,内层view不设置position,好像就没事了,你也试试。
2019-03-12 09:38