Thanks in advance for any help. I am very new to Android.
Here's my problem. I am using a TableLayout to display editable fields. There are about twenty rows to display.
The rows overflow the screen on smaller devices. I need the View to allow the user to scroll up and down. What am I missing?
Tried wrapping the TableLayout in a ScrollView, didn't work.
Vertical scroll view going to scroll its child view in Vertical direction so we have created Linear layout as a child for Vertical scroll view and added child for linear layout.
In Android, a ScrollView is a view group that is used to make vertically scrollable views. A scroll view contains a single direct child only. In order to place multiple views in the scroll view, one needs to make a view group(like LinearLayout) as a direct child and then we can define many views inside it.
put your TableLayout
inside ScrollView
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableLayout
android:id="@+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
</TableLayout>
</ScrollView>
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