Harmony Scroll不滚动的问题

在使用Scroll组件时设置了滚动的方向,内容也超出了页面的大小,但是就是不能滚动,原因是因为Scroll组件包裹下的容器组件设置了width或者height属性,下面以竖向滑动为例:

@Entry
@Component
struct Index {
  scroller:Scroller=new Scroller()
  @State message: string = 'Hello World'
  @State changeValue: string = ''
  @State submitValue: string = ''
  controller: SearchController = new SearchController()
  private centerDialog: CustomDialogController = new CustomDialogController({
    builder: UpgradeDialog(),
    alignment: DialogAlignment.Center
  })

  build() {
    Stack({ alignContent: Alignment.TopStart }) {
      Scroll(this.scroller) {
        Column() {
          Text(this.message)
            .fontSize(30)
            .fontWeight(FontWeight.Bold)
            .onClick(v => {
            })

          Progress({ value: 20, type: ProgressType.ScaleRing }).width(100)
          Progress({ value: 50, total: 100, type: ProgressType.Scal

你可能感兴趣的:(harmonyos,Scroll,Scroll不滚动的问题)