收藏
回答

scroll-view 不设定固定高度,高度会接近无限高怎么回事

框架类型 问题类型 操作系统 工具版本
小程序 Bug Windows v1.02.1911180
<view class="section-container">
  view scroll-x enable-flex="true" class="scroll-box">
    <block wx:for="{{aniDetails.crt}}" >
      <view class="crt-list">
        <view class="crt-icon-box">
          <image class="crt-icon" src="{{item.images.grid}}">image>
          "crt-role">{{item.role_name}}
        view>
        <view class="crt-name-box">
          "crt-name text-el">{{item.name_cn?item.name_cn:item.name}}
          <view class="crt-cvname-list text-el">
            <block wx:for="{{item.actors}}">
              "crt-cvname">CV:{{item.name}}\n
            block>
          view>
        view>
      view>
    block>
  view>
view>
.section-container {
  margin: 30rpx 40rpx;
}
.scroll-box {
  white-space: nowrap;
  display: flex;
}
.crt-list {
  display: inline-block;
  margin-right: 15rpx;
}
.crt-icon-box {
  position: relative;
  width: 150rpx;
  height: 150rpx;
}
.crt-icon {
  width: 100%;
  height: 100%;
}
.crt-role {
  position: absolute;
  top: 0;
  left: 0;
  background: #3bc0c3;
  color: #fff;
  width: 50rpx;
  height: 30rpx;
  border-radius: 30rpx;
  line-height: 30rpx;
  text-align: center;
  font-size: 22rpx;
}
.crt-name-box {
  margin-top: 10rpx;
  width: 150rpx;
}
.crt-name {
  display: block;
  font-size: 26rpx;
  color: #666;
  text-align: center;
  margin-bottom: 5rpx;
}
.crt-cvname-list {
  font-size: 22rpx;
  color: #999;
}

在开发工具端打开会这样,在手机预览正常显示

回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签