微信小程序开发中怎样实现Android环境下的横向滚动

php中世界最好的语言
php中世界最好的语言 原创
2018-06-05 11:43:02 1382浏览
<view class="tab bg">
          <scroll-view class="" scroll-x="true" style="width: 100%;white-space: nowrap; display: flex;overflow-x: auto;">
              <view style="display: inline-block" bindtap="switchIndex" class="tab-list {{index === 1 ?'on':''}}">首页</view>
              <view wx:for="{{tab}}" wx:key="index" data-id="{{item.id}}" data-index="{{index}}"
                 style="display: inline-block" bindtap="switchTab" class="tab-list {{tabIndex === index?'on':''}}">
                  {{item.nav_name}}
              </view>
          </scroll-view>
      </view>

代码一贴其实当测试小哥告诉你安卓tab不能滑的时候,你只需要加一个overflow-x: auto;哈哈哈

相信看了本文案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!

推荐阅读:

微信小程序开发上拉加载如何实现

微信小程序开发容器视图的使用

以上就是微信小程序开发中怎样实现Android环境下的横向滚动的详细内容,更多请关注php中文网其它相关文章!

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。