scroll-view 中设置scroll-x 安卓下显示不全
发布于 6 年前 作者 cuiyong 8810 次浏览 来自 问答
<scroll-view class='menu'  scroll-x="true" bindscroll="scroll">
   <view class='{{currentMenuIndex==index?"menu_item selected_menu":"menu_item"}}'
   wx:key="{{index}}"
   bindtap='onPressMemu'
   wx:for='{{menus}}'
   data-index="{{index}}">
   {{item}}
   </view>
 </scroll-view>

样式:

.menu {
  margin-top: 1rem;
  width: 100%;
  height: 4rem;
  line-height: 2rem;
  white-space: nowrap;
  display: flex;
}
  
.menu_item {
  display: inline-block;
  width: 10%;
  height: 2rem;
  margin: 0 .3rem;
  white-space: nowrap;
  text-align: center;
}

这个宽度只能用百分比吗?ios下横向是会显示全的 但android会被截掉后面一部分。求解

回到顶部