This is a sample XML i’ve written. I’m trying to make a vertically aligned list of buttons, and 2 more columns of such. So there will be 3 columns in total. Each column will be vertically scrollable. How do you add more columns and make them individually scrollable?
I’ve searched and tried several other variations; the closest I could get to is with the tablelayout, but vertical scrolling seemed impossible with that!
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/table"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns="*">
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/button1"/>
<Button
android:id="@+id/button2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/button2"/>
<Button
android:id="@+id/button3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/button3"/>
</TableLayout>
You could use one horizontal
LinearLayoutas the root container and then oneScrollViewfor each column with equal width and containing a verticalLinearLayout: