So i have a recyclerview like this :
as you can see, the screen width is not enough for displaying all the text nicely, so i need to add horizontal scroll so user can scroll horizontally and vertically at the same time, how do i do this?
Use HorizontalScrollView with LinearLayout as child. Set it's Orientation to horizontal and add your dynamic views to it.
<?xml version="1.0" encoding="utf-8"?>
<HorizontalScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="match_parent">
<LinearLayout
android:id="@+id/ll_main"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="match_parent">
// Add your dynamic views to this layout.
</LinearLayout>
</HorizontalScrollView>
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