scroller :控制器

direction : 方向

state :方式  on  off  auto

 ScrollBar({
        scroller : this.scrollController,
        state : BarState.On,
        direction:ScrollBarDirection.Horizontal
      }){
        Text('滚动条')
          .height(24)
          .backgroundColor(Color.Orange)
          .textAlign(TextAlign.Center)
      }.width(300).height(24)
      .backgroundColor(Color.Pink)

      ScrollBar({
        scroller : this.scrollController,
        state : BarState.On,
        direction:ScrollBarDirection.Vertical
      }){
        Text('滚动条')
          .width(24)
          .backgroundColor(Color.Orange)
          .textAlign(TextAlign.Center)
      }.width(24).height(300)
      .backgroundColor(Color.Pink)

Logo

讨论HarmonyOS开发技术,专注于API与组件、DevEco Studio、测试、元服务和应用上架分发等。

更多推荐