Hey i implemented a NestedScrollView in an Activity, but i cant show the scrollbar like i do in a ScrollView, can you guys.
How can I show it?
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/appBar">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical"
android:paddingLeft="@dimen/dimen_2"
android:paddingRight="@dimen/dimen_2">
</LinearLayout>
</android.support.v4.widget.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.
The Flutter documentation defines NestedScrollView as “A scrolling view inside of which can be nested other scrolling views, with their scroll positions being intrinsically linked.” This means that with NestedScrollView , you get two scrolling areas. One is the header part and the other is its body part.
In Android, a ScrollView is a view group that is used to make vertically scrollable views. A scroll view contains a single direct child only. In order to place multiple views in the scroll view, one needs to make a view group(like LinearLayout) as a direct child and then we can define many views inside it.
Use the android:scrollbars attribute.
Such as:
android:scrollbars="vertical"
android:scrollbars="horizontal"
android:scrollbars="vertical|horizontal"
For example:
<android.support.v4.widget.NestedScrollView
android:id="@+id/foo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical">
</android.support.v4.widget.NestedScrollView>
Documentation link: https://developer.android.com/reference/android/view/View.html#attr_android:scrollbars
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With