用flex布局固定头部尾部,今天在安卓上级上突然都失效了
.container{
display: flex;
flex-direction: column;
height:100%;
}
.header{
flex:0 0 120rpx;/* 不放大不缩小固定100rpx */
}
.scroll-wrap{
flex: 1;
display:flex;/* 如果不加这样那么scroll-view需要设置位置position;absolute */
position: relative;
}
.footer{
flex: 0 0 100rpx;
}
<view class="container">
<view class="header">
</view>
<view class="scroll-wrap">
<scroll-view class="left" scroll-y >
<van-cell
size="large"
wx:for = "{{category.list}}"
wx:key = "item"
title="{{category[item].cn}}"
data-key="{{item}}"
bindclick="onChangeActive"
/>
</scroll-view>
</View>
</view>

因为你没有设置宽度
麻烦提供能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)