I'm having troubles when tray to insert some images in a tablerow of tablelayout.
The first imageview expands the width of its own cell and the next images expands the rest of the row
How can i divide de row in five cells with equal size?
This is a snapshot of app
http://i41.tinypic.com/2dv77g6.png
This is the code of xml layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/gradient"
android:gravity="center"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:gravity="center_vertical|right"
android:orientation="horizontal" >
<ImageView
android:id="#+id/user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:contentDescription="#string/ES_user"
android:gravity="right"
android:src="#drawable/user" />
<TextView
android:id="#+id/TextUser"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="#string/ES_user"
android:textColor="#ffffff"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="#+id/User"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text=""
android:textColor="#ffffff"
android:textSize="16sp" />
<TextView
android:id="#+id/TextLogout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="#string/ES_logout"
android:textColor="#fc0505"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="5"
android:gravity="center" >
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|center_horizontal"
android:background="#drawable/roundcorners"
android:paddingBottom="20dp"
android:paddingLeft="30dp"
android:paddingRight="30dp"
android:paddingTop="20dp" >
<TableRow android:layout_weight="1" >
<ImageView
android:id="#+id/Logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|center_horizontal"
android:layout_weight="0.5"
android:contentDescription="#string/ES_logo"
android:paddingRight="25dp"
android:src="#drawable/logotra" />
<TableLayout
android:layout_width="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_weight="0.5" >
<TableRow android:layout_weight="1" >
<TextView
android:id="#+id/Textpatient"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_weight="1"
android:text="#string/ES_codpatient"
android:textColor="#000000"
android:textSize="15sp" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_weight="1" >
<EditText
android:id="#+id/TxtCodPatient"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:inputType="text" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="5dp"
android:layout_weight="1" >
<ImageView
android:id="#+id/ESlanguagebtn"
android:layout_width="wrap_content"
android:layout_marginRight="10dp"
android:layout_weight="0.166"
android:src="#drawable/esp" />
<ImageView
android:id="#+id/ENlanguagebtn"
android:layout_width="wrap_content"
android:layout_marginRight="10dp"
android:layout_weight="0.166"
android:src="#drawable/en" />
<ImageView
android:id="#+id/CATlanguagebtn"
android:layout_width="wrap_content"
android:layout_marginRight="10dp"
android:layout_weight="0.166"
android:src="#drawable/cat" />
<ImageView
android:id="#+id/GAlanguagebtn"
android:layout_width="wrap_content"
android:layout_marginRight="10dp"
android:layout_weight="0.166"
android:src="#drawable/ga" />
<ImageView
android:id="#+id/EUlanguagebtn"
android:layout_width="wrap_content"
android:layout_marginRight="10dp"
android:layout_weight="0.166"
android:src="#drawable/eusk" />
<ImageView
android:id="#+id/PTlanguagebtn"
android:layout_width="wrap_content"
android:layout_marginRight="10dp"
android:layout_weight="0.166"
android:src="#drawable/por" />
</TableRow>
<TableRow
android:layout_weight="1"
android:gravity="center" >
<Button
android:id="#+id/BtnStart"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="#string/ES_start" />
</TableRow>
</TableLayout>
</TableRow>
</TableLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_weight="1"
android:gravity="center|right" >
<TextView
android:id="#+id/large_appname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/ES_large_appname"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
Try to set the layout of your 5 country images as below:
As you are giving your each ImageView weight then to get the best result you must have to give width of the ImageView as 0dp.
Replace your 5 country code with below code and check out.
<TableRow
android:layout_width="fill_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="5dp"
android:layout_weight="1" >
<ImageView
android:id="#+id/ESlanguagebtn"
android:layout_width="0dp"
android:layout_marginRight="10dp"
android:layout_weight="0.166"
android:background="#drawable/icon" />
<ImageView
android:id="#+id/ENlanguagebtn"
android:layout_width="0dp"
android:layout_marginRight="10dp"
android:layout_weight="0.166"
android:src="#drawable/icon" />
<ImageView
android:id="#+id/CATlanguagebtn"
android:layout_width="0dp"
android:layout_marginRight="10dp"
android:layout_weight="0.166"
android:src="#drawable/icon" />
<ImageView
android:id="#+id/GAlanguagebtn"
android:layout_width="0dp"
android:layout_marginRight="10dp"
android:layout_weight="0.166"
android:src="#drawable/icon" />
<ImageView
android:id="#+id/EUlanguagebtn"
android:layout_width="0dp"
android:layout_marginRight="10dp"
android:layout_weight="0.166"
android:src="#drawable/icon" />
<ImageView
android:id="#+id/PTlanguagebtn"
android:layout_width="0dp"
android:layout_marginRight="10dp"
android:layout_weight="0.166"
android:src="#drawable/icon" />
</TableRow>
Let me know if still any problem.
Thanks.
Change this
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:gravity="center_vertical|right"
android:orientation="horizontal" >
to this
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:gravity="center_vertical|right"
android:orientation="horizontal" >
Related
I created a custom list view with table layout.
Now I want to show the text on the right. (You can see an example in the image, I cannot put this in the post)
But I cannot move textviews to the right.
http://i.stack.imgur.com/x57ly.png
my code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="top"
android:background="#drawable/bar_bg"
android:paddingTop="0dip" >
<TableLayout
android:id="#+id/tableLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
tools:ignore="RtlHardcoded" >
<TableRow
android:layout_marginTop="3dp"
tools:ignore="UselessParent"
>
<LinearLayout
android:layout_width="120dp"
android:layout_height="82dp"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
tools:ignore="RtlSymmetry" >
<ImageView
android:id="#+id/image"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_gravity="left|top"
android:scaleType="centerCrop"
tools:ignore="ContentDescription" />
</LinearLayout>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:paddingTop="0dp" >
<TableRow
android:layout_width="fill_parent"
android:layout_gravity="center_vertical"
android:textDirection="rtl"
tools:ignore="UnusedAttribute" >
<TextView
android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:layout_marginLeft="5dp"
android:layout_marginTop="9dp"
android:layout_marginBottom="10dp"
android:paddingRight="6dp"
android:gravity="right"
android:layout_span="1"
android:layout_weight="1"
android:textColor="#000000"
android:textSize="16sp" />
</TableRow>
<TableRow android:layout_width="fill_parent" >
<TextView
android:id="#+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:layout_marginBottom="10dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:gravity="right"
android:paddingRight="6dp"
android:textColor="#000000"
android:textSize="16sp"
tools:ignore="RtlHardcoded" />
</TableRow>
</TableLayout>
</TableRow>
</TableLayout>
<TextView
android:id="#+id/tvdarsad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="16dp"
android:textSize="22sp"
android:textAlignment="center"
android:textStyle="bold"
android:layout_marginTop="18dp"
android:background="#drawable/badge_ifaux"
android:text="%20"
android:textColor="#FFFFFF" />
<ImageView
android:id="#+id/imagecolor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="15dp"
android:layout_marginRight="4dp"
android:layout_alignParentTop="true"
android:src="#drawable/color1"/>
</RelativeLayout>
I think you implemented a complicated solution. You can achieve the same result using LinearLayout and distributing the weight between its views.
Here I post you have an example with your code with the same result of the photo.
Hope it helps.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3">
<ImageView
android:id="#+id/image"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight=".5"
tools:ignore="ContentDescription" />
<LinearLayout
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="2"
android:layout_marginLeft="20dp"
android:orientation="vertical">
<TextView
android:id="#+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="text1"
android:textColor="#000000"
android:textSize="16sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="text2"
android:textColor="#000000"
android:textSize="16sp" />
</LinearLayout>
<TextView
android:id="#+id/text2"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight=".3"
android:textColor="#000000"
android:textSize="16sp" />
<ImageView
android:id="#+id/imagecolor"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight=".2"
android:src="#drawable/abc_btn_borderless_material"/>
</LinearLayout>
I am keeping 9 images in a 3 rows like a 3X3 matrix. I am getting error while we are providing layout_weightsum so i changed it to weightsum. still it is showing me error. I am using Andorid Studio.
Below is my code.
<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"
android:id="#+id/third_screen">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/scroll_screen3"
android:layout_alignParentTop="true"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/retreat_2"
android:id="#+id/screen3_view">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="CHOOSE YOUR RETREAT"
android:id="#+id/txt_welcome"
android:focusableInTouchMode="false"
android:layout_gravity="center_horizontal"
android:textSize="20sp"
android:textColor="#ffffffff"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="10dp"
android:gravity="center_horizontal" />
<ImageView
android:layout_width="match_parent"
android:layout_height="40dp"
android:id="#+id/hover"
android:src="#drawable/hover"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp" />
<LinearLayout
android:background="#drawable/outline1"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="418dp"
android:layout_margin="20dp"
android:weightsum="3"
android:id="#+id/outline_pockets" >
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:id="#+id/first_line_pockets"
android:layout_weightsum="3"
android:layout_weight="1"
android:layout_marginTop="10dp">
<ImageView
android:layout_width="60dp"
android:layout_height="80dp"
android:id="#+id/pocket11"
android:src="#drawable/img1"
android:layout_weight="1" />
<ImageView
android:layout_width="60dp"
android:layout_height="80dp"
android:id="#+id/pocket12"
android:src="#drawable/img2"
android:layout_weight="1" />
<ImageView
android:layout_width="60dp"
android:layout_height="80dp"
android:id="#+id/pocket13"
android:src="#drawable/img3"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/first_line_txt"
android:layout_gravity="center_vertical"
android:weightsum="3" >
<TextView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="UNREASONABLE JOY"
android:layout_gravity="center_horizontal"
android:lines="2"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:gravity="center_vertical|center_horizontal"
android:textSize="13sp"
android:layout_weight="1"
android:id="#+id/txt_pocket11" />
<TextView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="LIGHTEN UP"
android:layout_gravity="center_horizontal"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:gravity="center_vertical|center_horizontal"
android:textSize="13sp"
android:layout_weight="1"
android:id="#+id/txt_pocket12" />
<TextView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="RELEASING DISEASE"
android:id="#+id/txt_pocket13"
android:lines="2"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:layout_gravity="center_horizontal"
android:gravity="center_vertical|center_horizontal"
android:textSize="13sp"
android:textIsSelectable="false"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="#+id/second_line_pockets"
android:weightsum="3"
android:layout_weight="1">
<ImageView
android:layout_width="60dp"
android:layout_height="80dp"
android:id="#+id/pocket21"
android:src="#drawable/img4"
android:layout_weight="1" />
<ImageView
android:layout_width="60dp"
android:layout_height="80dp"
android:id="#+id/pocket22"
android:src="#drawable/img5"
android:layout_weight="1" />
<ImageView
android:layout_width="60dp"
android:layout_height="80dp"
android:id="#+id/pocket23"
android:src="#drawable/img6"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:id="#+id/second_line_txt"
android:weightsum="3" >
<TextView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="BEYOND FEVER"
android:autoText="false"
android:lines="2"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:textSize="13sp"
android:gravity="center_vertical|center_horizontal"
android:layout_weight="1"
android:id="#+id/txt_pocket21" />
<TextView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="UNSHAKEABLE LOVE"
android:layout_gravity="center_horizontal"
android:lines="2"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:textSize="13sp"
android:gravity="center_vertical|center_horizontal"
android:layout_weight="1"
android:id="#+id/txt_pocket22" />
<TextView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="PEACEFUL PARENTING"
android:textSize="13sp"
android:lines="2"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:layout_gravity="center_horizontal"
android:gravity="center_vertical|center_horizontal"
android:layout_weight="1"
android:id="#+id/txt_pocket23" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="#+id/third_line_pockets"
android:weightsum="3"
android:layout_weight="1">
<ImageView
android:layout_width="60dp"
android:layout_height="80dp"
android:id="#+id/pocket31"
android:src="#drawable/img7"
android:layout_weight="1" />
<ImageView
android:layout_width="60dp"
android:layout_height="80dp"
android:id="#+id/pocket32"
android:src="#drawable/img8"
android:layout_weight="1" />
<ImageView
android:layout_width="60dp"
android:layout_height="80dp"
android:id="#+id/pocket33"
android:src="#drawable/img9"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/third_line_txt"
android:weightsum="3"
android:layout_marginBottom="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="GETTING UNSTUCK"
android:autoText="false"
android:layout_gravity="center_vertical"
android:lines="2"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:gravity="center_vertical|center_horizontal"
android:textIsSelectable="false"
android:textSize="13sp"
android:layout_weight="1"
android:id="#+id/txt_pocket31" />
<TextView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="WARRIOR MONK"
android:lines="2"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:layout_gravity="center_vertical"
android:gravity="center_vertical|center_horizontal"
android:textSize="13sp"
android:layout_weight="1"
android:id="#+id/txt_pocket32" />
<TextView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="FILLING YOUR CUP"
android:lines="2"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:layout_gravity="center_vertical"
android:gravity="center_vertical|center_horizontal"
android:textSize="13sp"
android:singleLine="false"
android:layout_weight="1"
android:id="#+id/txt_pocket33" />
</LinearLayout>
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="80dp"
android:id="#+id/no_more"
android:src="#drawable/no_more"
android:layout_marginTop="10dp" />
<ImageView
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="#+id/retreat_quiz"
android:src="#drawable/retreat_quiz"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp" />
</LinearLayout>
</ScrollView>
</RelativeLayout>
The correct spelling for the attribute is weightSum, not weightsum or layout_weightsum.
However, the system can calculate the sum for you. You can just omit the attribute altogether.
I am making a activity layout using RelativeLayout i want the image view to be in most left and textview to be in center and checkbox to be in most right but layoutgravity and gravity is not working please can somebody help
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="#+id/imageViewTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_weight="1"
android:gravity="left"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/textViewTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="Time" />
<CheckBox
android:id="#+id/checkBoxTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:=""
android:gravity="right" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="#+id/imageViewCompass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_weight="1"
android:gravity="left"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/textViewCompass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="Compass" />
<CheckBox
android:id="#+id/checkBoxCompass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:gravity="right" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="#+id/imageViewMap"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_weight="1"
android:gravity="left"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/textViewMap"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="Map" />
<CheckBox
android:id="#+id/checkBoxMap"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:gravity="right" />
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="#+id/imageViewTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_weight="1"
android:gravity="left"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/textViewTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/imageViewTime"
android:layout_weight="1"
android:gravity="center"
android:text="Time" />
<CheckBox
android:id="#+id/checkBoxTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_weight="1"
android:gravity="right" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="#+id/imageViewCompass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_weight="1"
android:gravity="left"
android:src="#drawable/ic_launcher" />
<CheckBox
android:id="#+id/checkBoxCompass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_weight="1"
android:gravity="right" />
<TextView
android:id="#+id/textViewCompass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/imageViewCompass"
android:layout_weight="1"
android:gravity="center"
android:text="Compass" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="#+id/imageViewMap"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_weight="1"
android:gravity="left"
android:src="#drawable/ic_launcher" />
<CheckBox
android:id="#+id/checkBoxMap"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_weight="1"
android:gravity="right" />
<TextView
android:id="#+id/textViewMap"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/imageViewMap"
android:layout_weight="1"
android:gravity="center"
android:text="Map" />
</RelativeLayout>
below is my layout which ontain 5 butons i want to show button with equal width and height also margin of internal layout on top and below willbe same but screen show out of layout see image http://imgur.com/TBwf0gI i want to show my 5 buttons with eqal space form top and botton for all size screens but my screen show out of layout check it
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/layoutbordercolor" >
<ImageView
android:id="#+id/btnback"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingBottom="5dp"
android:paddingLeft="3dp"
android:paddingTop="10dp"
android:src="#drawable/back" />
<ImageView
android:id="#+id/bitmap"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:src="#drawable/logostar" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"
android:orientation="vertical" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:paddingTop="12dp"
android:text="San Diego Unified"
android:textColor="#603311"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:text="SCHOOL DISTRICT"
android:textColor="#603311"
android:textSize="10sp" />
</LinearLayout>
<ImageView
android:id="#+id/button2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingBottom="5dp"
android:paddingTop="10dp"
android:src="#drawable/options1" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="20dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="30dp"
android:background="#drawable/layout_border"
android:orientation="vertical"
android:paddingBottom="30dp" >
<ImageView
android:id="#+id/facebook"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginTop="45dp"
android:src="#drawable/facebook" />
<ImageView
android:id="#+id/twitter"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginTop="15dp"
android:src="#drawable/twitter" />
<ImageView
android:id="#+id/farmtoschool"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginTop="15dp"
android:src="#drawable/farm_to_school" />
<ImageView
android:id="#+id/takeasurvey"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginTop="15dp"
android:src="#drawable/take_a_survey" />
<ImageView
android:id="#+id/test_button_image2"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginBottom="40dp"
android:layout_marginTop="15dp"
android:src="#drawable/share_this_app" />
</LinearLayout>
</LinearLayout>
try This....
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#E5E5E5"
android:weightSum="100"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="20"
android:background="#drawable/layoutbordercolor" >
<ImageView
android:id="#+id/btnback"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingBottom="5dp"
android:paddingLeft="3dp"
android:paddingTop="10dp"
android:src="#drawable/back" />
<ImageView
android:id="#+id/bitmap"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:src="#drawable/logostar" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"
android:orientation="vertical" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:paddingTop="12dp"
android:text="San Diego Unified"
android:textColor="#603311"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:text="SCHOOL DISTRICT"
android:textColor="#603311"
android:textSize="10sp" />
</LinearLayout>
<ImageView
android:id="#+id/button2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingBottom="5dp"
android:paddingTop="10dp"
android:src="#drawable/options1" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="80"
android:layout_marginBottom="20dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="30dp"
android:background="#drawable/layout_border"
android:orientation="vertical"
android:paddingBottom="30dp" >
<ImageView
android:id="#+id/facebook"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginTop="45dp"
android:src="#drawable/facebook" />
<ImageView
android:id="#+id/twitter"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginTop="15dp"
android:src="#drawable/twitter" />
<ImageView
android:id="#+id/farmtoschool"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginTop="15dp"
android:src="#drawable/farm_to_school" />
<ImageView
android:id="#+id/takeasurvey"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginTop="15dp"
android:src="#drawable/take_a_survey" />
<ImageView
android:id="#+id/test_button_image2"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginBottom="40dp"
android:layout_marginTop="15dp"
android:src="#drawable/share_this_app" />
</LinearLayout>
I will show you an example and you try to implement this
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/rl1">
<Button
android:id="#+id/btn1"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:text="click"/>
<TextView
android:id="#+id/txt1"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_alignParentTop="true"
android:layout_marginLeft="34dp"
android:layout_toRightOf="#+id/btn1"
android:text=" some text here" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:layout_marginTop="40dp">
<Button
android:id="#+id/abc"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:fontFamily="Arial" />
<Button
android:id="#+id/abc2"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_below="#+id/abc"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:fontFamily="Arial" />
</RelativeLayout>
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:text="Button" />
</RelativeLayout>
Always try to reduce the no of layouts inside a single layout. So to use RelativeLayout which is more customizable than others for any requirements
Use padding like this:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingBottom="your_size"
android:background="#E5E5E5"
android:orientation="vertical" >
This should works.
I have a situation, in that situation one view contain imageviews on upper part and list view in the lower part and when we scrolling it is only scroll listview part but i have to scroll whole view simultaneously with single scroll.
I have used add header functionality of list view but in that i have to put seperate xml file of imageview and listview and i need to put them in one xml file. how can i do it..
<ViewFlipper
android:id="#+id/viewFlipper"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="#+id/header_relativelayout" >
<!-- //settings First view Setting -->
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="3dp"
android:paddingRight="3dp" >
<LinearLayout
android:id="#+id/first_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3" >
<TextView
android:id="#+id/textView_chooseteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="d"
android:textColor="#color/gray"
android:textSize="10sp"
android:visibility="invisible" />
<ImageView
android:id="#+id/imageView_cbk"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="#drawable/cbk_btn" />
<TextView
android:id="#+id/textView_chooseteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="d"
android:textColor="#color/gray"
android:textSize="20sp"
android:visibility="invisible" />
<ImageView
android:id="#+id/imageView_cfb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="#drawable/cfb_btn" />
<TextView
android:id="#+id/textView_chooseteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="d"
android:textColor="#color/gray"
android:textSize="20sp"
android:visibility="invisible" />
<ImageView
android:id="#+id/imageView_mlb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="#drawable/mlb_btn" />
<TextView
android:id="#+id/textView_chooseteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="d"
android:textColor="#color/gray"
android:textSize="10sp"
android:visibility="invisible" />
</LinearLayout>
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:text="#string/Games_Placebet_chooseteam"
android:textColor="#color/gray"
android:textSize="10sp"
android:textStyle="bold"
android:visibility="invisible" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="3" >
<TextView
android:id="#+id/textView_chooseteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="d"
android:textColor="#color/gray"
android:textSize="10sp"
android:visibility="invisible" />
<ImageView
android:id="#+id/imageView_nba"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="#drawable/nba_btn" />
<TextView
android:id="#+id/textView_chooseteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="d"
android:textColor="#color/gray"
android:textSize="20sp"
android:visibility="invisible" />
<ImageView
android:id="#+id/imageView_nfl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="#drawable/nfl_btn" />
<TextView
android:id="#+id/textView_chooseteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="d"
android:textColor="#color/gray"
android:textSize="20sp"
android:visibility="invisible" />
<ImageView
android:id="#+id/imageView_nhl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="#drawable/nhl_btn" />
<TextView
android:id="#+id/textView_chooseteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="d"
android:textColor="#color/gray"
android:textSize="10sp"
android:visibility="invisible" />
</LinearLayout>
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:text="#string/Games_Placebet_chooseteam"
android:textColor="#color/gray"
android:textSize="12sp"
android:visibility="invisible" />
</LinearLayout>
<LinearLayout
android:id="#+id/middle_line"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/first_view"
android:orientation="vertical" >
<ImageView
android:id="#+id/small_line"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="#drawable/small_line" />
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:text="f"
android:textColor="#color/gray"
android:textSize="5sp"
android:visibility="invisible" />
</LinearLayout>
<LinearLayout
android:id="#+id/list_header_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/middle_line" >
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="dd"
android:textColor="#color/gray"
android:textSize="14sp"
android:visibility="invisible" />
<TextView
android:id="#+id/list_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Recent Activities"
android:textColor="#color/gray"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/list_header_layout" >
<ExpandableListView
android:id="#id/android:list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/first_view"
android:cacheColorHint="#00000000"
android:childDivider="#android:color/black"
android:divider="#android:color/black"
android:fadingEdge="none"
android:scrollingCache="false" >
</ExpandableListView>
</LinearLayout>
</RelativeLayout>
//settings Second view Setting
<RelativeLayout
android:id="#+id/progressrelative"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center_vertical|center_horizontal"
android:gravity="center_vertical|center_horizontal" >
<ProgressBar
android:id="#+id/progressbar2"
style="#android:style/Widget.ProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center_vertical|center_horizontal"
android:gravity="center_vertical|center_horizontal"
android:indeterminate="true"
android:visibility="gone" />
<ListView
android:id="#+id/channellist"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/frameLayout"
android:layout_below="#+id/header_relativelayout"
android:cacheColorHint="#00000000"
android:divider="#android:color/transparent"
android:fadingEdge="none"
android:scrollingCache="false" >
</ListView>
</RelativeLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:id="#+id/betView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="8dp" >
<TextView
android:id="#+id/textView_chooseteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:text="#string/Games_Placebet_chooseteam"
android:textColor="#color/gray"
android:textSize="16sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/gm4_headar_parch"
android:gravity="center" >
<TextView
android:id="#+id/button_date_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:text="Saturday, 10/27/2012 at 01:00 PM"
android:textColor="#color/white"
android:textSize="13sp" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginTop="-5dp"
android:background="#drawable/gm4_1white_bg"
android:orientation="vertical"
android:paddingLeft="5dp"
android:paddingRight="5dp" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal"
android:paddingLeft="5dp"
android:paddingRight="5dp" >
<TextView
android:id="#+id/button_hometeam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:clickable="true"
android:text="Denver Broncos"
android:textColor="#color/gray"
android:textSize="16sp"
android:textStyle="bold" />
<ImageView
android:id="#+id/imageView_button_hometeam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:src="#drawable/game_click_btn" />
</RelativeLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dp"
android:layout_marginTop="8dp"
android:background="#drawable/recent_bigpatch_line" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal"
android:paddingLeft="5dp"
android:paddingRight="5dp" >
<TextView
android:id="#+id/button_visitorteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="SD Chargers"
android:textColor="#color/gray"
android:textSize="16sp"
android:textStyle="bold" />
<ImageView
android:id="#+id/imageView_button_visitorteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:src="#drawable/game_unclick_btn" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:text="Betting Amount"
android:textColor="#color/gray"
android:textSize="16sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/upper_relative"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/gm4_headar_parch"
android:orientation="horizontal"
android:paddingLeft="8dp"
android:paddingRight="8dp" >
<TextView
android:id="#+id/textView_placebet_balance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:paddingTop="2dp"
android:text="#string/Games_Placebet_balance"
android:textColor="#android:color/white"
android:textSize="16sp"
android:textStyle="bold" />
<!--
<TextView
android:id="#+id/textView_placebet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:paddingRight="32dp"
android:paddingTop="4dp"
android:text="$"
android:textColor="#android:color/white"
android:textStyle="bold" />
-->
<TextView
android:id="#+id/textView_placebet_dollar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:paddingRight="10dp"
android:paddingTop="4dp"
android:text="100"
android:textColor="#android:color/white"
android:textStyle="bold" />
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="-5dp"
android:background="#drawable/gm4_1white_bg"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp" >
<TextView
android:id="#+id/button_placebet_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="Denver Broncos"
android:textColor="#color/gray"
android:textSize="16sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="10dp"
android:background="#drawable/recent_bigpatch_line" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="3dp"
android:layout_marginTop="10dp" >
<Button
android:id="#+id/button_placebet_up_counter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:background="#drawable/pg_2_up_arrow_btn" />
<Button
android:id="#+id/textview_placebet_counter_digipanel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:background="#drawable/counter_digitaldisplay"
android:textColor="#109EE6" />
<Button
android:id="#+id/button_placebet_counter_down"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:background="#drawable/pg_2_down_arrow_btn" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="vertical" >
<Button
android:id="#+id/button_betaganist"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:background="#drawable/bet_against_btn_new"
android:gravity="center_horizontal|center_vertical"
android:paddingBottom="5dp"
android:text="#string/Games_Placebet_betaganist"
android:textColor="#color/white"
android:textSize="18sp"
android:textStyle="bold" />
<Button
android:id="#+id/button_placebet"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#drawable/placebet_btn_new"
android:gravity="center_horizontal|center_vertical"
android:paddingBottom="5dp"
android:text="Place Bet"
android:textColor="#android:color/white"
android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<ListView
android:id="#+id/friendlist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/frameLayout"
android:layout_below="#+id/header_relativelayout"
android:cacheColorHint="#00000000"
android:divider="#android:color/transparent"
android:fadingEdge="none"
android:scrollingCache="false" >
</ListView>
</ViewFlipper>
here is a code of xml file in which i have used viewflipper and in that i have added views so the first view is image view on upper side listview on the lower side when we click on image view next view will flip and so on... but in the first view it is scrolling only listview part i need to scroll whole view with single scroll.
THanks in advance..
The issue is, all the possible ways to mix in two scrolls does not yield well ( to best of my knowledge), Setting the header xml is probably the best approach for it. try to find a way around the situation.