There are different ways to utilize a ListView in a ScrollView without showing a scrollbar:
android:scrollbars
attribute to none
.<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none">
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@null"
android:overScrollMode="never"
android:scrollbarStyle="outsideOverlay"/>
</ScrollView>
wrap_content
so that it only occupies the required height, and it will not require scrolling.<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@null"
android:overScrollMode="never"
android:scrollbarStyle="outsideOverlay"/>
</ScrollView>
android:nestedScrollingEnabled
attribute to the ListView.<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@null"
android:overScrollMode="never"
android:nestedScrollingEnabled="true"
android:scrollbarStyle="outsideOverlay"/>
</ScrollView>
Using any of the above methods, the ListView can be utilized in a ScrollView without a scrollbar.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2022-03-08 11:00:00 +0000
Seen: 9 times
Last updated: Oct 10 '22
How can I detect when someone clicks outside of an Android Compose ModalBottomSheetLayout?
What is the process to activate the screen time off feature in Android using AOSP customization?
What is the proper way to rotate the View Component in React Native for Android?
What is the process of using the Volley library to upload a file on Android?
Is it not possible to set another activity as the main activity in Android Studio?
How can I utilize xml to implement a color filter on an ImageView?
Is it impossible to modify the color of button text on Android?