小程序中使用横向溢出滚动 ios中点击元素修改字体颜色时溢出部分无法修改字体颜色 安卓正常 啥原因?
发布于 5 年前 作者 liulei 7419 次浏览 来自 官方Issues

上面是点击选中后 下面是初始状态

wxml部分
<view class="scroll_class"  
  class="answer {{item.userTopicId === option.id ? 'isChoose' : ''}}" 
  wx:for="{{item.optionList}}"
  wx:key="opIndex" 
  wx:for-item="option" 
  wx:for-index="opIndex">
    <view class="answerText" catchtap="pageClick" data-type="choose" data-item="{{option}}" data-pindex="{{index}}">{{option.showContent}}</view>
</view>
wxss部分
.answer {
    width590rpx;
    height110rpx;
    border-radius55rpx;
    font-size36rpx;
    color#000000;
    background#F6F6F6;
    margin-top40rpx;
    text-align: left;
    box-sizing: border-box;
    transition: all 0.3s;
}
.answerText {
    line-height110rpx;
    box-sizing: border-box;
    white-space: nowrap;
    overflow-x: scroll;
    margin0 40rpx 0 96rpx;
    max-width100%;
}
.isChoose {
    background: linear-gradient(180deg,#1FB6ED,#1F83ED);
    color: white;
}

1 回复

你好,检查下是否是尺寸没调整好?

回到顶部