I use the following code to create TableLayout, which can be scrolled horizontally:
<?xml version="1.0" encoding="utf-8"?>
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="200dp"
android:scrollbars="none">
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/maintable2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="*"
android:background ="#dddddd"
android:scrollbars="none" >
</TableLayout>
</HorizontalScrollView>
I need columns in TableLayoutto at least fill the screen (i.e. if there is only one column, the borders of these columns should stretch across the screen, if there are two columns, the borders of both columns should fill the screen, etc.).
How can i do this?
source
share