美文网首页
嵌套滚动2024-07-30

嵌套滚动2024-07-30

作者: iOS打怪升级 | 来源:发表于2024-07-29 14:26 被阅读0次
tab 页面内部是一个横向滚动的第三方ListView ,发现无法滑动listview

解决办法:增加listNestedScroll ,嵌套滚动设置,默认不可以嵌套滚动,另外发现系统的List 不会出现该问题,系统的List 默认是子视图优先响应滑动

Tab(){
TabContent(){
  ListView({
           initialIndex: this.currentIndex,
           controller: this.controller,
           items: this.lessonList,
           itemLayout: ((item, index) => {
             this.itemLayout(index, this.lessonList[index])
           }),
           listAttribute: ((attri: ListAttr) => {
             attri.listDirection = Axis.Horizontal;
             attri.height = 95;
           }),
           listNestedScroll:{scrollForward:NestedScrollMode.SELF_ONLY, scrollBackward:NestedScrollMode.SELF_ONLY}
         })
}
}

相关文章

网友评论

      本文标题:嵌套滚动2024-07-30

      本文链接:https://www.haomeiwen.com/subject/zmlwhjtx.html