I have a "grid_test.xml"
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/linearLayoutGrid"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<GridView
android:id="#+id/gridView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:columnWidth="90dp"
android:gravity="center"
android:horizontalSpacing="5dp"
android:numColumns="auto_fit"
android:stretchMode="columnWidth"
android:verticalSpacing="5dp" >
</GridView>
</LinearLayout>
I am including this in another layout with header and footer:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="#+id/commonlayout" >
<LinearLayout android:id="#+id/llheader"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#android:color/white">
<RelativeLayout android:id="#+id/relativeLayout1"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_gravity="center">
<Button
android:id="#+id/Button_Logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginRight="2dp"
android:layout_centerVertical="true"
android:background="#drawable/ic_launcher"/>
<Button
android:id="#+id/Button_settings"
android:layout_marginLeft="2dp"
android:layout_width="wrap_content"
android:layout_centerVertical="true"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="#drawable/ic_launcher"/>
</RelativeLayout>
</LinearLayout>
<ScrollView android:id="#+id/svdata"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FFFFFF"
android:layout_below="#+id/llheader"
android:layout_above="#+id/llfooter" >
<LinearLayout
android:id="#+id/lldata"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#color/backgound_color"
android:orientation="vertical"
android:padding="5dp" >
<include layout="#layout/grid_test" />
</LinearLayout>
</ScrollView>
<LinearLayout android:id="#+id/llfooter"
android:layout_width="fill_parent"
android:orientation="horizontal"
android:layout_height="wrap_content"
android:visibility="visible"
android:layout_margin="0dp"
android:layout_alignParentBottom="true"
>
<RadioGroup
android:id="#+id/radiogroup"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#android:color/black"
android:orientation="horizontal" >
<RadioButton
android:id="#+id/btnOption1"
style="#style/navbar_button"
android:drawableTop="#drawable/ic_launcher"
android:singleLine="true"/>
<RadioButton
android:id="#+id/btnOption2"
style="#style/navbar_button"
android:drawableTop="#drawable/ic_launcher"
android:singleLine="true"/>
<RadioButton
android:id="#+id/btnOption3"
style="#style/navbar_button"
android:drawableTop="#drawable/ic_launcher"/>
</RadioGroup>
</LinearLayout>
</RelativeLayout>
My problem is that the included GridView layout does not fill the screen between header and footer.
What could be causing the problem?
Ok. I found it. Removing the ScrollView, makes it work as expected.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="#+id/commonlayout" >
<LinearLayout android:id="#+id/llheader"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#android:color/white">
<RelativeLayout android:id="#+id/relativeLayout1"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_gravity="center">
<Button
android:id="#+id/Button_Logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginRight="2dp"
android:layout_centerVertical="true"
android:background="#drawable/ic_launcher"/>
<Button
android:id="#+id/Button_settings"
android:layout_marginLeft="2dp"
android:layout_width="wrap_content"
android:layout_centerVertical="true"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="#drawable/ic_launcher"/>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/lldata"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#color/backgound_color"
android:orientation="vertical"
android:layout_below="#+id/llheader"
android:layout_above="#+id/llfooter"
android:padding="5dp" >
<include layout="#layout/grid_test" />
</LinearLayout>
<LinearLayout android:id="#+id/llfooter"
android:layout_width="fill_parent"
android:orientation="horizontal"
android:layout_height="wrap_content"
android:visibility="visible"
android:layout_margin="0dp"
android:layout_alignParentBottom="true"
>
<RadioGroup
android:id="#+id/radiogroup"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#android:color/black"
android:orientation="horizontal" >
<RadioButton
android:id="#+id/btnOption1"
style="#style/navbar_button"
android:drawableTop="#drawable/ic_launcher"
android:singleLine="true"/>
<RadioButton
android:id="#+id/btnOption2"
style="#style/navbar_button"
android:drawableTop="#drawable/ic_launcher"
android:singleLine="true"/>
<RadioButton
android:id="#+id/btnOption3"
style="#style/navbar_button"
android:drawableTop="#drawable/ic_launcher"/>
</RadioGroup>
</LinearLayout>
</RelativeLayout>
Related
I have the following code but somehow the button I have on the right is stuck to the edge instead of having a margin of 41dp to the left of imageView. Is there anyway I can have have a working marginRight of 41dp (similar to the left button I have)
Have been stuck at this simple problem for a ridiculous amount of time, help is appreciated!
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_marginBottom="50dp">
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:padding="5dp"
app:cardCornerRadius="20dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="500dp">
<ImageView
android:id="#+id/image"
android:layout_width="338dp"
android:layout_height="338dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginStart="12dp"
android:layout_marginTop="4dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
app:srcCompat="#drawable/formal" />
<ImageButton
android:id="#+id/dislike"
android:layout_width="75dp"
android:layout_height="72dp"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="41dp"
android:layout_marginBottom="26dp"
app:srcCompat="#drawable/ic_thumbs_down_white" />
<ImageButton
android:id="#+id/like"
android:layout_width="75dp"
android:layout_height="72dp"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="41dp"
android:layout_marginBottom="26dp"
app:srcCompat="#drawable/ic_thumbs_up_white" />
<Button
android:id="#+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/image"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="16dp"
android:layout_marginBottom="94dp"
android:text="WEAR THIS" />
</RelativeLayout>
</android.support.v7.widget.CardView>
Try this
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:padding="5dp"
app:cardCornerRadius="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="500dp"
android:orientation="vertical">
<ImageView
android:id="#+id/image"
android:layout_width="338dp"
android:layout_height="338dp"
android:src="#mipmap/ic_launcher"
android:layout_margin="10dp"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="WEAR THIS"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="41dp"
android:layout_marginBottom="26dp"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:src="#mipmap/ic_launcher"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="41dp"
android:layout_marginBottom="26dp"
android:src="#mipmap/ic_launcher"/>
</RelativeLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
The result is
My Portrait View is looks Fine
My Landscape View alignment is collapsed
this is my code of activity_main.xml
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/drawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
android:id="#+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fillViewport="true">
<LinearLayout
android:id="#+id/linear_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/img_slideshow_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView android:id="#+id/img_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/indicator"
android:background="#color/PrimaryColor"
android:gravity="center"
android:ellipsize="end"
android:paddingBottom="2dp"
android:paddingLeft="5dp"
android:paddingRight="2dp"
android:paddingTop="2dp"
android:singleLine="true"
android:textColor="#ededed" />
</RelativeLayout>
<View android:id="#+id/div_a"
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_below="#+id/img_slideshow_layout"
android:background="#color/view_divider_color" />
<View android:id="#+id/div_b"
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_below="#+id/div_a"
android:background="#color/view_divider_color_2" />
<com.studiobluelime.utils.CirclePageIndicator
android:id="#+id/indicator"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/view_pager"
android:layout_marginBottom="4dp" />
</RelativeLayout>
<!--<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ProgressBar
style="#style/Base.Widget.AppCompat.ProgressBar"
android:id="#+id/progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:indeterminate="true" />
<android.support.v7.widget.RecyclerView
android:id="#+id/card_recycler_view"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>-->
<!-- <android.support.v7.widget.RecyclerView
android:id="#+id/card_recycler_view_new"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"/>-->
</LinearLayout>
</ScrollView>
<ImageView
android:layout_width="wrap_content"
android:layout_height="100dp"
app:srcCompat="#drawable/shop_online"
android:layout_marginLeft="140dp"
android:id="#+id/shop_online"
android:scaleType="fitXY"
android:adjustViewBounds="true"
android:layout_marginTop="200dp"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="#drawable/nandme"
android:adjustViewBounds="true"
android:layout_marginLeft="30dp"
android:layout_marginTop="320dp"
android:scaleType="fitXY"
android:id="#+id/nandme"/>
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
app:srcCompat="#drawable/storelocation"
android:adjustViewBounds="true"
android:layout_marginLeft="258dp"
android:id="#+id/storelocation"
android:scaleType="fitXY"
android:layout_marginTop="250dp"/>
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
app:srcCompat="#drawable/promotins"
android:adjustViewBounds="true"
android:layout_marginLeft="20dp"
android:id="#+id/promotins"
android:scaleType="fitXY"
android:layout_marginTop="240dp"/>
<android.support.v4.view.ViewPager
android:id="#+id/view_pager"
android:layout_width="fill_parent"
android:layout_height="157dp" />
</android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.NavigationView
android:id="#+id/navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
app:itemIconTint="#color/PrimaryDarkColor"
app:itemTextColor="#color/colorAccent"
app:itemBackground="#drawable/ripple"
app:menu="#menu/navigation_items" />
</android.support.v4.widget.DrawerLayout>
I wrote this code in four layouts: layout/activity_main.xml,layout-small/ activity_main.xml, layout-large/activity_main.xml, layout-xlarge/activity_main.xml but it did not change. I have attached a screen shot here. Please click the above name "My Portrait View is looks Fine My Landscape View alignment is collapsed"
This my code in this I have been using scrollView and inside it two textViews to add more content but it is working only when there is one textView please what changes i do to add more content?And here I want space between those textViews(content) but in my code i am trying for that but the content is overlapped and there is no proper space between contents.please help me..!
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.hp.kludge.AndroidActivity">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:weightSum="1">
<TextView
android:id="#+id/tvA"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:text="ANDROID"
android:textColor="#f6080101"
android:textColorHighlight="#df1425"
android:textSize="35dp"
android:textStyle="bold" />
<View
android:layout_width="match_parent"
android:background="#e62027"
android:layout_height="2dp"
android:layout_below="#+id/tvC" />
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/scrollView"
android:fillViewport="true"
android:orientation="vertical">
<TextView
android:id="#+id/tvWhat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/tvC"
android:layout_marginTop="44dp"
android:text="What is Android?"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="22dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Content"
android:id="#+id/tvt" />
</ScrollView>
</LinearLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Next"
android:id="#+id/butNext"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:background="#abc3fb" />
</RelativeLayout>
I would like to center a LinearLayout in a RelativeLayout but i have a problem, the margin-bottom stays attached to bottom. Here is the view :
http://nsa33.casimages.com/img/2013/03/12//130312103139937791.png
And here is the code of the layout :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/group_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/white"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/carreGlobalInterieur"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="#color/grisTresClair" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/border_deals"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/GroupLigneOne"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#color/grisClair"
android:orientation="vertical" >
<TextView
android:id="#+id/CategorieDeal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:text="My Category"
android:textColor="#color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true" >
<TextView
android:id="#+id/nouveauPrixVert"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="10.99 €"
android:textColor="#color/green"
android:textStyle="bold" />
<TextView
android:id="#+id/ancienPrixRouge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="7dp"
android:layout_marginRight="6dp"
android:text="20.90 €"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/red"
android:textSize="13sp"
android:textStyle="bold" />
<TextView
android:id="#+id/reductionPrix"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="4dp"
android:text="(-34%)"
android:textColor="#color/red"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:id="#+id/ligneTwo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="3dp"
android:orientation="vertical" >
<TextView
android:id="#+id/titreEnGros"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:layout_marginTop="3dp"
android:text="Here is an example of a compleete title in a TextView Android"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/black"
android:textSize="16sp" />
</LinearLayout>
<RelativeLayout
android:id="#+id/ligneFour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:orientation="vertical" >
<TextView
android:id="#+id/dateAjout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="il y a 2 heures" />
<TextView
android:id="#+id/siteWeb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="5dp"
android:text="Amazon" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
If you have some ideas to center the block, please help me !
When using the RelativeLayout, you can use android:layout_centerInParent="true", which will do what it says, center it inside its parent.
I am trying to build a program where users data is displayed in table view while Home,About and Settings are to be displayed in TabLayout just below the table layout but TabLayout is not shown on screen while program runs. Here I have two class file one to display table layout whereas another to display TabLayout.Below is my main.xml file:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="7dp">
<TextView
android:id="#+id/item_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:padding="2dp"
android:textSize="10dp" />
<TableRow
android:id="#+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView android:text="" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:minWidth="40dp" android:background="#drawable/top_left" android:textColor="#ffffffff"/>
<TextView android:text="Civil Bank " android:paddingLeft="5dp" android:textStyle="bold" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:minWidth="40dp" android:background="#drawable/top_middle" android:textColor="#ffffffff"/>
<TextView android:text="Sunrise Bank" android:paddingLeft="5dp" android:textStyle="bold" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:minWidth="40dp" android:background="#drawable/top_right" android:textColor="#ffffffff"/>
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView android:text="Web user" android:paddingLeft="5dp" android:layout_width="fill_parent" android:layout_weight="1" android:layout_height="wrap_content" android:background="#drawable/bottom_middle" android:textColor="#ffffffff"/>
<TextView android:text="0.00" android:paddingLeft="5dp" android:id="#+id/webuserTxtView" android:layout_width="fill_parent" android:layout_weight="1" android:layout_height="wrap_content" android:background="#drawable/bottom_middle" android:textColor="#ffffffff"/>
<TextView android:text="0.00" android:paddingLeft="5dp" android:id="#+id/S_webuserTxtView" android:layout_width="fill_parent" android:layout_weight="1" android:layout_height="wrap_content" android:background="#drawable/bottom_middle" android:textColor="#ffffffff" />
</TableRow>
<TableRow
android:id="#+id/tableRow3"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView android:text="Transfer" android:paddingLeft="5dp" android:layout_width="fill_parent" android:layout_weight="1" android:layout_height="wrap_content" android:background="#drawable/bottom_middle" android:textColor="#ffffffff"/>
<TextView android:text="0.00" android:paddingLeft="5dp" android:id="#+id/transferTxtView" android:layout_width="fill_parent" android:layout_weight="1" android:layout_height="wrap_content" android:background="#drawable/bottom_middle" android:textColor="#ffffffff"/>
<TextView android:text="0.00" android:paddingLeft="5dp" android:id="#+id/S_transferTxtView" android:layout_width="fill_parent" android:layout_weight="1" android:layout_height="wrap_content" android:background="#drawable/bottom_middle" android:textColor="#ffffffff"/>
</TableRow>
<TableRow
android:id="#+id/tableRow4"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView android:text="Cash" android:paddingLeft="5dp" android:layout_width="fill_parent" android:layout_weight="1" android:layout_height="wrap_content" android:background="#drawable/bottom_right" android:textColor="#ffffffff"/>
<TextView android:text="0.00" android:paddingLeft="5dp" android:id="#+id/cashTxtView" android:layout_width="fill_parent" android:layout_weight="1" android:layout_height="wrap_content" android:background="#drawable/bottom_middle" android:textColor="#ffffffff"/>
<TextView android:text="0.00" android:paddingLeft="5dp" android:id="#+id/S_cashTxtView" android:layout_width="fill_parent" android:layout_weight="1" android:layout_height="wrap_content" android:background="#drawable/bottom_left" android:textColor="#ffffffff"/>
</TableRow>
<TabHost
android:id="#android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabWidget
android:id="#android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="#android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
</TabHost>
</TableLayout>
</LinearLayout>
You have given the width and height of your tablelayout as fill-parent.So it would probably occupy the whole space of your linearlayout. Instead of fill-parent you have to use wrap-content. In tabhost you use the property android:layout_below="#+id/yourTableLayout".