ScrollView Inside ScrollView

后端 未结 13 861
隐瞒了意图╮
隐瞒了意图╮ 2020-11-22 15:40

I Know people from Google have asked us not to put Scrollable view inside another Scrollable view but is there any official statement from them directing us not to do so?

13条回答
  •  旧时难觅i
    2020-11-22 16:06

    Is this close enough?

    You should never use a HorizontalScrollView with a ListView, since ListView takes care of its own scrolling. Most importantly, doing this defeats all of the important optimizations in ListView for dealing with large lists, since it effectively forces the ListView to display its entire list of items to fill up the infinite container supplied by HorizontalScrollView.

    http://developer.android.com/reference/android/widget/HorizontalScrollView.html

    UPDATE:

    Since you may be forced to use a two dimensional scrollview, you may consider using this: Internet archive of blog.gorges.us/2010/06/android-two-dimensional-scrollview/

    I haven't used this but it may be a reasonable approach.

提交回复
热议问题