html52.com
我爱小程序-开发者交流社区

scroll-view

问题模块 框架类型 问题类型 操作系统版本 手机型号 微信版本
客户端 小程序 Bug android 8.1.0 华为荣耀10 小米max2 6.7.3

te .on{background: #fff;color: #6E4EB9;border-left: 3px solid #6E4EB9}有的手机有时候   整个scroll-view会上移  导致头部几个分类看不见了



有的手机有时候   整个scroll-view会上移  导致头部几个分类看不见了

同一个手机 有时候行有时候不行


wxml:

<scroll-view class='fir-cate' scroll-y style="height: {{windowHeight}}px;">

<block wx:for="{{cateList}}" wx:key="k">

<view bindtap='bindFirCate' data-cid="{{item.id}}" data-index="{{index}}" class="scroll-view-item {{index == firIdx ? 'on':''}}">{{item.name}}</view>

</block>

</scroll-view>


js:

wx.getSystemInfo({

    success: function (res) {

        that.setData({ windowHeight: res.windowHeight })

        console.log(res.windowHeight)

    }

})


wxss:

.fir-cate{

width: 25%;

border-right: 1px solid #e4e4e4;

position: fixed;

top: 0;

}

.fir-cate .scroll-view-item{

height: 40px;

line-height: 40px;

text-align: center;

background: #F5F5F5;

border-bottom:1px solid #fff;

}

.fir-cate .on{

background: #fff;

color: #6E4EB9;

border-left: 3px solid #6E4EB9

}



评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付