/ / Нуждаете се от хоризонтално превъртане на оформлението на таблицата - Android, Android и джаджа

Нуждаете се от хоризонтално превъртане на оформлението на таблицата - Android, Android и джаджа

Имам таблица, която има 3 колонидефинирани. Но поради големия текст във втората колона съдържанието излиза извън екрана. Така че аз се опитвах да поставя хоризонтален Scrollbar. Но не можа да го направи.

Използвам Android 1.5 като цел.

XML код на оформлението на таблицата

<?xml version="1.0" encoding="utf-8"?>

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:scrollbars="horizontal"
android:layout_height="fill_parent"
android:layout_width="fill_parent">


<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:stretchColumns="0,1,2"
android:id="@+id/tLayout"
android:scrollbars="horizontal"

>
<TableRow
android:layout_width="fill_parent">
<TextView
android:padding="3dip"
android:gravity="left"
android:text="Name"
/>
<TextView
android:padding="3dip"
android:gravity="left"
android:text="Address"
/>
<TextView
android:padding="3dip"
android:gravity="left"
android:text="Age"
/>
</TableRow>
</TableLayout>
</ScrollView>

Отговори:

1 за отговор № 1
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:scrollbars="vertical">

<HorizontalScrollView
android:layout_width="320px" android:layout_height="fill_parent">

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linlay" android:layout_width="320px"
android:layout_height="fill_parent" android:stretchColumns="1"
android:background="#000000"/>

</HorizontalScrollView>

</ScrollView>