Android: ScrollView vs NestedScrollView

前端 未结 6 2599
太阳男子
太阳男子 2020-11-29 17:48

What is the difference between ScrollView and NestedScrollView? Both of them, extend FrameLayout. I want to know in depth pros and con

6条回答
  •  情话喂你
    2020-11-29 18:27

    NestedScrollView

    NestedScrollView is just like ScrollView, but it supports acting as both a nested scrolling parent and child on both new and old versions of Android. Nested scrolling is enabled by default.

    https://developer.android.com/reference/android/support/v4/widget/NestedScrollView.html

    ScrollView

    Layout container for a view hierarchy that can be scrolled by the user, allowing it to be larger than the physical display. A ScrollView is a FrameLayout, meaning you should place one child in it containing the entire contents to scroll; this child may itself be a layout manager with a complex hierarchy of objects

    https://developer.android.com/reference/android/widget/ScrollView.html

提交回复
热议问题