文档开发者中心
我的
|

HarmonyOS 5

Scroll组件内显示不全问题

问题描述:

收起
自动换行
深色代码主题
复制
@Entry 
@Component 
struct ScrollTest { 
  scroller: Scroller = new Scroller() 
 
  build() { 
    Column() { 
      Column() { 
        Text('testText') 
          .height(100) 
        Scroll() { 
          Column() { 
            Button('Securetest') 
              .width('100%') 
              .height(50) 
              .margin({ bottom: 2 }) 
              .onClick(() => { 
              }) 
            Button('test') 
              .width('100%') 
              .height(50) 
              .margin({ bottom: 2 }) 
            Button('test') 
              .width('100%') 
              .height(50) 
              .margin({ bottom: 2 }) 
            Button('test') 
              .width('100%') 
              .height(50) 
              .margin({ bottom: 2 }) 
            Button('test') 
              .width('100%') 
              .height(50) 
              .margin({ bottom: 2 }) 
            Button('test') 
              .width('100%') 
              .height(50) 
              .margin({ bottom: 2 }) 
            Button('test') 
              .width('100%') 
              .height(50) 
              .margin({ bottom: 2 }) 
            Button('test') 
              .width('100%') 
              .height(50) 
              .margin({ bottom: 2 }) 
            Button('test') 
              .width('100%') 
              .height(50) 
              .margin({ bottom: 2 }) 
            Button('test') 
              .width('100%') 
              .height(50) 
              .margin({ bottom: 2 }) 
            Button('test') 
              .width('100%') 
              .height(50) 
              .margin({ bottom: 2 }) 
            Button('test') 
              .width('100%') 
              .height(50) 
              .margin({ bottom: 2 }) 
            Button('test') 
              .width('100%') 
              .height(50) 
              .margin({ bottom: 2 }) 
            Button('test') 
              .width('100%') 
              .height(50) 
              .margin({ bottom: 2 }) 
            Button('test') 
              .width('100%') 
              .height(50) 
              .margin({ bottom: 2 }) 
            Button('test') 
              .width('100%') 
              .height(50) 
              .margin({ bottom: 2 }) 
            Button('test') 
              .width('100%') 
              .height(50) 
              .margin({ bottom: 2 }) 
            Button('test') 
              .width('100%') 
              .height(50) 
              .margin({ bottom: 2 }) 
            Button('test') 
              .width('100%') 
              .height(50) 
              .margin({ bottom: 2 }) 
            Button('test20') 
              .width('100%') 
              .height(50) 
              .margin({ bottom: 2 }) 
          } 
        } 
      } 
    } 
  } 
}
点赞
收藏
回复
3
分享
举报
浏览459 发布于2024-06-19 09:40北京
全部评论
最多点赞
最新发布
最早发布
设置高度或者layoutweight(1)都可以解决
1
2楼回复于2024-06-20 01:29 来自广东
  • nickname
    layoutweight(1)还是不能解决
    2024-11-28 03:05 来自北京

解决方案:

Scroll组件未设置高度,设置高度即可解决。
1楼回复于2024-06-19 09:40 来自北京
写回答
新增插入模板功能
一键使用模板,快速填写内容,轻松发帖~
知道了
  • 为了保障您的信息安全,请勿上传您的敏感个人信息(如您的密码等信息)和您的敏感资产信息(如关键源代码、签名私钥、调试安装包、业务日志等信息),且您需自行承担由此产生的信息泄露等安全风险。
  • 如您发布的内容为转载内容,请注明内容来源。

我要发帖子

了解社区公约,与您携手共创和谐专业的开发者社区。