android
ScrollView a TableLayout inside a TabHost
I am trying to scroll a TableLayout that is nested inside a Tab. I can scroll the Table as intended but the problem is that the Table when scrolls up, it shows up behind the Tab as it scrolls. I want to make just the Table part of the Layout to scroll. At the end there is a RelativeLayout which serves as a legend(Key Guide) of the information that I will show dynamically in the form of rows inside the Table. SO it needs to be at the bottom of the screen and should not scroll like the table itself. But in this code everything below the Tab scrolls up (except the RelativeLayout) <LinearLayout xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:baselineAligned="false" android:orientation="vertical"> //Fixed On Screen <TabHost android:id="#android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent" > <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TabWidget android:id="#android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" > </TabWidget> //Fixed On Screen <TableLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingTop="4dp" > <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="fill_horizontal" android:padding="4dp" > <TextView style="#android:style/TextAppearance.Medium" android:layout_weight="1" android:text="#string/start" android:textStyle="bold" android:typeface="serif" /> <TextView style="#android:style/TextAppearance.Medium" android:layout_weight="1" android:text="#string/end" android:textStyle="bold" android:typeface="serif" /> <TextView style="#android:style/TextAppearance.Medium" android:layout_weight="1" android:paddingLeft="5dp" android:text="#string/effect" android:textStyle="bold" android:typeface="serif" /> </TableRow> </TableLayout> </LinearLayout> //Scroll this content inside the Tab ONLY <FrameLayout android:id="#android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center_horizontal" > <ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content" > <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > <TableLayout android:id="#+id/Tab1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingTop="4dp" android:stretchColumns="*" > </TableLayout> <TableLayout android:id="#+id/Tab2" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingTop="4dp" android:stretchColumns="*" > </TableLayout> </LinearLayout> </ScrollView> </FrameLayout> </TabHost> //Fixed On Screen at the very bottom so the area between this and Tab is what scrolls <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" > <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" > <TextView android:layout_width="wrap_content" android:layout_height="30dp" android:layout_weight="1" android:background="#color/green" android:padding="5dp" android:text="#string/excellent" android:textColor="#FFFFFF" /> <TextView android:layout_width="wrap_content" android:layout_height="30dp" android:layout_weight="1" android:background="#color/light_blue" android:padding="5dp" android:text="Good" android:textColor="#FFFFFF" /> <TextView android:layout_width="wrap_content" android:layout_height="30dp" android:layout_weight="1" android:background="#color/dark_gray" android:padding="5dp" android:text="#string/normal" android:textColor="#FFFFFF" /> <TextView android:layout_width="wrap_content" android:layout_height="30dp" android:layout_weight="1" android:background="#color/red" android:padding="5dp" android:text="Bad" android:textColor="#FFFFFF" /> </TableRow> </RelativeLayout> In short, I want the following to be fixed on screen: The Tab The First TableLayout The Last RelativeLayout And want only the middle FrameLayout/TableLayout to Scroll. This layout will be filled with rows dynamically. I have a feeling that it is as simple as maybe a wrap_content or fill_parent maybe. But can't seem to figure this out. Thanks!
Related Links
Alt/Enter to import missing classes
Android Firebase Nested Query
Drawer Nav and Fragments?
Android CharSequence[] Array Doesn't work
Does Firebase change app key hash for Facebook?
LRUCACHE in custom gridview
How to prevent my android activity from going to isFinishing()?
How can i create Andriod Virtual Device (AVD) on Mac Sierra
AES/CBC/PKCS5 Padding and MD5 in iOS and Android
VideoView to Display Embeded Video
how to retrieve blocked google play account
Getting data from one activity and storing in another activity at app relaunch
Android Firebase and AdMob plugin not found
Retrofit API call receives “HTTP FAILED: java.io.IOException: Canceled”
Unable to attach debugger in Android Studio - localhost:8600 java.net.ConnectException
Using google cloud ml with Android app