i wan tto create sccreen like this image http://imgur.com/UVKCZdu my screen url is looklike this http://imgur.com/gLQw4iV
my screen not adjust facebook twitter iccon also show space on bottom below 3 buttons how do i fixed them? help me below is my xml code
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#C0C0C0" >
<ImageView
android:id="#+id/test_button_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:paddingTop="5dp"
android:src="#drawable/icon" >
</ImageView>
<TextView
android:id="#+id/test_button_text2"
android:layout_width="wrap_content"
android:paddingTop="10dp"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/test_button_image"
android:paddingLeft="10dp"
android:layout_toRightOf="#+id/test_button_image"
android:text="San Diego Unified"
android:textColor="#000000"
android:textSize="20sp" >
</TextView>
<TextView
android:id="#+id/test_button_text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:layout_alignLeft="#+id/test_button_text2"
android:layout_below="#+id/test_button_text2"
android:paddingBottom="10dp"
android:text="SCHOOL DISTRICT"
android:textColor="#000000" >
</TextView>
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="40dp"
a
android:orientation="horizontal" >
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="left|center_vertical"
android:singleLine="true"
android:text="HEALTHY BODIES HEALTHY MINDS "
android:textColor="#000000"
android:textSize="12sp" />
<ImageButton
android:id="#+id/button"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:src="#drawable/facebook" />
<ImageButton
android:id="#+id/button"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:src="#drawable/twitter"
android:text="Button Text" />
</LinearLayout>
<RelativeLayout
android:layout_marginTop="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<EditText
android:id="#+id/editText1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Search School By Name"
android:layout_centerVertical="true" >
</EditText>
<ImageView
android:id="#+id/imageView1"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/editText1"
android:layout_alignBottom="#+id/editText1"
android:layout_alignRight="#+id/editText1"
android:src="#drawable/title_search" />
</RelativeLayout>
<TextView
android:id="#+id/txtCaption"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:paddingBottom="3dp"
android:paddingLeft="10dp"
android:paddingTop="3dp"
android:text="SELECT A SCHOOL TO VIEW LUNCH OR BREAKFAST MENUS"
android:textColor="#000000"
android:textSize="10sp"
android:textStyle="bold" />
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#000000" />
<LinearLayout
android:id="#+id/lytContent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/txtCopyright"
android:background="#ffffff"
android:layout_below="#+id/lytTitlebar"
android:orientation="vertical" >
<ListView
android:id="#+id/listMainMenu"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:divider="#color/background"
android:dividerHeight="1dip"
android:fadeScrollbars="true" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#a8a8a8"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#a8a8a8"
android:orientation="horizontal" >
<Button
android:id="#+id/button1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.333"
android:background="#drawable/button_style"
android:text="FARM TO SCHOOL"
android:textColor="#color/text"
android:textSize="8sp"
android:textStyle="bold" />
<Button
android:id="#+id/button2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.333"
android:background="#drawable/button_style"
android:text="TAKE A SURVEY"
android:textColor="#color/text"
android:textSize="8sp"
android:textStyle="bold" />
<Button
android:id="#+id/button3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.333"
android:background="#drawable/button_style"
android:text="SHARE THIS APP"
android:textColor="#color/text"
android:textSize="8sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
You can't setText in an ImageView.. that's just for TextViews
What you can do instead is wrap an ImageView and a TextView inside a FrameLayout, then do your setText on the TextView. Make sure you define the ImageView first, so it's below the TextView's z-order.
Add image to text view like this:
<TextView
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:drawableRight="#drawable/protection_unprotected"
android:gravity="center_vertical"
android:paddingRight="5dp"
android:text="#string/protection_unprotected"
android:textSize="18sp"
android:textStyle="bold" />
android:drawableRight="#drawable/protection_unprotected"
For your Facebook and Twitter buttons you can add
android:background = "#null"
inside ImageButton tags for the unwanted background in buttons.
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#a8a8a8"
android:orientation="horizontal" >
<RelativeLayout
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:id="#+id/headerLinearLay"
android:orientation="horizontal">
<ImageView
android:id="#+id/avatarImageView"
android:src="#drawable/icon"
android:layout_height="wrap_content"
android:layout_width="wrap_content"></ImageView>
<TextView
android:id="#+id/usernameTextView"
android:text="TextView"
android:paddingLeft="4dp"
android:layout_toRightOf="#id/avatarImageView"
android:layout_centerVertical="true"
android:layout_height="wrap_content"
android:layout_width="wrap_content"></TextView>
</RelativeLayout>
</LinearLayout>
Related
image `
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="top"
android:orientation="vertical">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:gravity="left"
android:text="Satisfied"
android:textSize="15dp"
android:textStyle="normal" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="150dp"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<com.example.rupertfernandes.itsforyou.progressutil.ProgressIndicator
android:id="#+id/determinate_progress_indicator1"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginLeft="30dp" />
<TextView
android:layout_width="fill_parent"
android:layout_height="150dp"
android:gravity="center"
android:text="Satisfied"
android:textColor="#7CFC00"
android:textSize="25dp"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dp"
android:layout_margin="10dp"
android:background="#ffffff" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TextView
android:id="#+id/questiontext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:padding="10dp"
android:text="Question of the Day"
android:textColor="#7CFC00"
android:textSize="20dp" />
<TextView
android:id="#+id/questiontextOne"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:padding="10dip"
android:text="Q-1. How are you feeling today ?"
android:textColor="#ff69b4"
android:textSize="15dp" />
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true">
<include
android:id="#+id/cell1"
layout="#layout/radiobutton"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:id="#+id/questiontextTwo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:padding="10dip"
android:text="Q-3. How is the day going on ?"
android:textColor="#ff69b4"
android:textSize="15dp" />
<LinearLayout
android:id="#+id/linearLayout3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true">
<include
android:id="#+id/cell1"
layout="#layout/radiobutton"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:id="#+id/questiontextThree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:padding="10dip"
android:text="Q-4. How is the work going on ?"
android:textColor="#ff69b4"
android:textSize="15dp" />
<LinearLayout
android:id="#+id/linearLayout4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true">
<include
android:id="#+id/cell1"
layout="#layout/radiobutton"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:id="#+id/questiontextFour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:padding="10dip"
android:text="Q-5. How is the night going on ?"
android:textColor="#ff69b4"
android:textSize="15dp" />
<LinearLayout
android:id="#+id/linearLayout5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true">
<include
android:id="#+id/cell1"
layout="#layout/radiobutton"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<Button
android:id="#+id/btnsubmitwellbeing"
android:layout_width="fill_parent"
android:background="#7CFC00"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Submit"
android:textAllCaps="false"
android:textColor="#ffffff"
android:textSize="25dp"
android:textStyle="bold" />
</LinearLayout>
</ScrollView>
</LinearLayout>
</LinearLayout>
below is the include code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="3dp"
android:weightSum="1" >
<RadioGroup
android:id="#+id/radioGroupWell"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<RadioButton
android:id="#+id/extremely_unsatisfied"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".2"
android:button="#null"
android:gravity="center"
android:onClick="extremely_unsatisfied"
android:text="Extremely Unsatisfied"
android:drawableTop="#drawable/user_icon"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000000" >
</RadioButton>
<RadioButton
android:id="#+id/unsatisfied"
android:layout_width="0dp"
android:button="#null"
android:layout_height="wrap_content"
android:layout_weight=".2"
android:drawableTop="#drawable/user_icon"
android:gravity="center"
android:onClick="unsatisfied"
android:text="Unsatisfied"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000000" >
</RadioButton>
<RadioButton
android:id="#+id/neutral"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".2"
android:button="#null"
android:drawableTop="#drawable/user_icon"
android:gravity="center"
android:text="Neutral"
android:onClick="neutral"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000000" >
</RadioButton>
<RadioButton
android:id="#+id/satisfied"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".2"
android:drawableTop="#drawable/user_icon"
android:gravity="center"
android:button="#null"
android:onClick="satisfied"
android:text="Satisfied"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000000" >
</RadioButton>
<RadioButton
android:id="#+id/extremly_satisfied"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".2"
android:drawableTop="#drawable/user_icon"
android:gravity="center"
android:onClick="extremly unsatisfied"
android:text="Extremely Satisfied"
android:button="#null"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000000" >
</RadioButton>
</RadioGroup>
</LinearLayout>
`I have attached a file.
It has 5 radiobuttons in one row..and there are 5 such rows..the radiobuttons are inside a scroll view.
kindly help with xml file and the code as to how to check the radio buttons and also on click of submit the value in the circular progress bar should increase based on the user input in the radio buttonsthe image is as shown
You can't attach files here.
RadioButtons have an OnCheckChangedLister that does what you'd expect. Or you can call isChecked() to poll the value.
I would like show my Page view header like below,
I'm using the following layout using, but the image and second textview not moving to right, its all align center.
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="6"
android:background="#drawable/transbg"
android:gravity="center"
android:orientation="vertical" >
<TableRow
android:id="#+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="6"
android:gravity="center"
>
<TextView
android:id="#+id/txtName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Magasin"
android:textColor="#FFF"
android:textSize="18sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:src="#drawable/yellow2" />
<TextView
android:id="#+id/tvCredits"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="test"
android:textColor="#fff"
android:textSize="16sp" />
</LinearLayout>
</TableRow>
</LinearLayout>
</LinearLayout>
how I can align one image view and textview right aligned.
Check out this one and let me know if it is what you want.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="6"
android:background="#drawable/ic_launcher"
android:gravity="center"
android:orientation="vertical" >
<TableRow
android:id="#+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="6"
android:background="#android:color/black"
android:gravity="center" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/txtName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="Magasin"
android:textColor="#FFF"
android:textSize="18sp"
android:textStyle="bold" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:src="#drawable/ic_launcher"
android:layout_toLeftOf="#+id/tvCredits" />
<TextView
android:id="#+id/tvCredits"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:text="test"
android:textColor="#fff"
android:textSize="16sp" />
</RelativeLayout>
</TableRow>
</LinearLayout>
EDIT : If you want to make the same layout with easier and more efficient way, you can use this one.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#android:color/black" >
<TextView
android:id="#+id/txtName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="Magasin"
android:textColor="#FFF"
android:textSize="18sp"
android:textStyle="bold" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="#+id/tvCredits"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/tvCredits"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:text="test"
android:textColor="#fff"
android:textSize="16sp" />
</RelativeLayout>
// try this way
<?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="wrap_content"
android:gravity="center"
android:padding="5dp"
android:orientation="horizontal" >
<TextView
android:id="#+id/txtName"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="Magasin"
android:textColor="#FFF"
android:gravity="center"
android:textSize="18sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_launcher"
android:adjustViewBounds="true"/>
<TextView
android:id="#+id/tvCredits"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="test"
android:textColor="#fff"
android:textSize="16sp"
android:layout_marginLeft="5dp"/>
</LinearLayout>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="right">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="6"
android:background="#drawable/transbg"
android:gravity="center"
android:orientation="vertical" >
<TableRow
android:id="#+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="6"
android:gravity="center"
>
<TextView
android:id="#+id/txtName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Magasin"
android:textColor="#FFF"
android:textSize="18sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="right|center"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:src="#drawable/yellow2" />
<TextView
android:id="#+id/tvCredits"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="test"
android:textColor="#fff"
android:textSize="16sp" />
</LinearLayout>
</TableRow>
</LinearLayout>
</LinearLayout>
</LinearLayout>
There is a list view and other text views in my screen.
I want to show the list in whole the screen and other elements in the bottom of the list.
Below is the code I used.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/relative_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/background_light_blue" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/background_light_blue"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/header1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#layout/header_gradients"
android:orientation="vertical"
android:paddingBottom="8dip"
android:paddingTop="8dip" >
<TextView
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_marginLeft="10dip"
android:layout_weight="1"
android:gravity="center"
android:text="#string/shopping_cart"
android:textColor="#color/white"
android:textSize="15sp"
android:textStyle="bold" />
</LinearLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/background_light_blue"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:layout_marginTop="5dip"
android:background="#color/white"
android:orientation="horizontal"
android:padding="5dp" >
<TextView
android:id="#+id/purchase_order"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:layout_marginTop="2dp"
android:text="Requisitioner"
android:textColor="#color/black"
android:textSize="15sp"
android:typeface="sans" />
<TextView
android:id="#+id/requisitioner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#id/purchase_order"
android:layout_marginBottom="3dp"
android:layout_marginLeft="6dp"
android:layout_marginTop="5dp"
android:text="Requisitioner"
android:textColor="#color/black"
android:textSize="15sp" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:contentDescription="#string/image"
android:src="#drawable/shopping_cart" />
</RelativeLayout>
<TextView
android:id="#+id/products_and_services"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="3dp"
android:layout_marginTop="15dp"
android:gravity="center_horizontal"
android:text="#string/products_and_services"
android:textColor="#color/black"
android:textSize="17sp"
android:textStyle="bold" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<LinearLayout
android:id="#+id/lr1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ListView
android:id="#android:id/list"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_weight="0.12" >
</ListView>
</LinearLayout>
<LinearLayout
android:id="#+id/pagingPanel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#id/lr1"
android:background="#drawable/background_light_blue"
android:orientation="vertical" >
<TextView
android:id="#+id/note_to_approver"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="3dp"
android:layout_marginTop="10dp"
android:gravity="center_horizontal"
android:text="#string/note_to_approver"
android:textColor="#color/black"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="#+id/note"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="2dp"
android:background="#color/white"
android:maxLines="10"
android:padding="5dp"
android:text="hijnjn"
android:textColor="#color/black"
android:textSize="15sp"
android:typeface="sans" />
<TextView
android:id="#+id/approver"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="1dp"
android:layout_marginTop="15dp"
android:gravity="center_horizontal"
android:text="#string/approvers"
android:textColor="#color/black"
android:textSize="17sp"
android:textStyle="bold" />
<Button
android:id="#+id/approvers"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:background="#drawable/options_menu"
android:drawableRight="#drawable/arrow_right"
android:gravity="left|center"
android:text="#string/approvers"
android:textColor="#color/black"
android:textSize="16sp"
android:textStyle="bold"
android:typeface="sans" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
<LinearLayout
android:id="#+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:background="#layout/btn_background" >
<Button
android:id="#+id/release_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:background="#drawable/btn_blue"
android:text="Approve(1)/Reject(0)"
android:textColor="#color/white"
android:textSize="15sp"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>
My requirement: Now the list is scrolling within the given area. I want to show in the whole screen and the scrolling should be only for the screen.
Please help me to do this.
You should not put a Vertically scrolling widget/view (ListView) in another vertically scrolling view (ScrollView). Though there are a few ways mentioned here and here which might help you achieve what you wish but that will increase the CPU load.
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.
MY XMl code looks like :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="wrap_content">
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="430dp"
android:fadingEdge="none"
>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/descriptionanth"
android:orientation="vertical"
android:id="#+id/searchjobslayout"
>
<ImageView android:id="#+id/homeimage_one" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_width="fill_parent" android:background="#drawable/logoblack"></ImageView>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="match_parent">
<TextView
android:id="#+id/keywords"
android:text="Search by keyword:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textStyle="bold"
android:textColor="#000000"
android:layout_marginLeft="10dp"
></TextView>
<EditText
android:id="#+id/keywordsedit"
android:hint=" Enter KeyWords"
android:layout_width="fill_parent"
android:layout_height="32dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:textSize="14sp"
android:background="#drawable/text_field"
android:layout_marginTop="5dp"
android:textColorHint="#FFFFFF"
android:paddingLeft="10dp"
android:textColor="#000000"
></EditText>
<Button
android:id="#+id/search"
android:text="Search"
android:layout_width="fill_parent"
android:layout_height="35dp"
android:textColor="#FFFFFF"
android:background="#drawable/buttonclick"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:textSize="20sp"
></Button>
<TextView
android:id="#+id/browseby"
android:text="Browse by:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textStyle="bold"
android:textColor="#000000"
android:layout_marginLeft="10dp"
android:paddingTop="10dp"></TextView>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<Button
android:id="#+id/jobsbycity"
android:text="City"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:textColor="#FFFFFF"
android:background="#drawable/buttonclick"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:textStyle="bold"
android:textSize="15sp"
></Button>
<Button
android:id="#+id/jobsbytype"
android:text="Category"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:textColor="#FFFFFF"
android:background="#drawable/buttonclick"
android:layout_below="#id/jobsbycity"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:textStyle="bold"
android:layout_marginTop="5dp"
android:textSize="15sp"
></Button>
<TextView
android:id="#+id/signin"
android:text="Signed in as"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="#000000"
android:layout_centerInParent="true"
android:gravity="center_horizontal"
android:layout_below="#id/jobsbytype"
android:paddingTop="10dp"></TextView>
<TextView
android:id="#+id/signinas"
android:text="mail_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12sp"
android:layout_centerInParent="true"
android:textColor="#000000"
android:gravity="center_horizontal"
android:layout_below="#id/signin"
android:paddingTop="5dp"></TextView>
<TextView
android:id="#+id/logout"
android:text="Sign out"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13sp"
android:gravity="center_vertical"
android:textColor="#000000"
android:layout_below="#id/signinas"
android:layout_centerInParent="true"
android:layout_marginTop="20dp"
android:textStyle="bold" ></TextView>
</RelativeLayout>
</LinearLayout>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
</ScrollView>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/tabbarbottom"
android:layout_gravity="bottom"
>
<Button
android:id="#+id/jobs"
android:text="About Us"
android:layout_width="100dp"
android:layout_height="fill_parent"
android:textColor="#drawable/white"
android:background="#android:color/transparent"
android:layout_alignParentBottom="true"
android:textStyle="bold"
android:textSize="12.5sp"
></Button>
<Button
android:id="#+id/aboutus"
android:text="Value"
android:layout_width="100dp"
android:layout_height="fill_parent"
android:textColor="#drawable/white"
android:layout_toRightOf="#id/jobs"
android:background="#android:color/transparent"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_alignParentBottom="true"
android:layout_marginLeft="10dp"
android:textStyle="bold"
android:textSize="12.5sp"
></Button>
<Button
android:id="#+id/benefits"
android:text="History"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textColor="#drawable/white"
android:layout_toRightOf="#id/aboutus"
android:background="#android:color/transparent"
android:layout_centerVertical="true"
android:layout_alignParentBottom="true"
android:textStyle="bold"
android:textSize="12.5sp"
></Button>
</RelativeLayout>
</LinearLayout>
I want to place the relative layout (last relative layout which having 3 buttons it, after scrollview ) at the bottom my screen. but its not happening
what to do??
Edited: The happening is i statically placed the relative layout by specifying padding, when running in portrait mode i made it fix at bottom but when i changed to landscape its not at bottom. How to place relativelayout in bottom in either cases??
Thanks
Add following line to your Relative layout
android:layout_alignParentBottom="true"
This must be work.
Happy coding.
Here the solution I tested and which works :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="100dp"
android:layout_weight="1.0" android:fadingEdge="none">
...
</ScrollView>
<RelativeLayout android:orientation="horizontal"
android:layout_width="fill_parent" android:layout_height="60dip"
android:background="#drawable/tabbarbottom">
<Button android:id="#+id/jobs" android:text="About Us"
android:layout_width="100dp" android:layout_height="fill_parent"
...></Button>
<Button android:id="#+id/aboutus" android:text="Value"
android:layout_width="100dp" android:layout_height="fill_parent"
...></Button>
<Button android:id="#+id/benefits" android:text="History"
android:layout_width="fill_parent" android:layout_height="fill_parent" ...></Button>
</RelativeLayout>
</LinearLayout>
The first LinearLayout should have layout_height="fill_parent".
This way it takes up the whole screen.
The ScrollView should have a
small fixed height, and an extra android:layout_weight="1.0" : it
will take up whatever space is remaining.
The RelativeLayout should
have a fixed height (it will always take up the same space at the
bottom of the screen), and the Buttons inside of it should have
layout_height="fill_parent" (to have the same height as the
RelativeLayout).
Make parent layout as relative layout. layout which contain button put that on bottom using
android:layout_alignParentBottom="true"
This will work
In the ScrollView
android:fillViewport="false"
#Udaykiran Hey Your Code for XMl is ok please check here i put your code with some change and i found only one change in this Relative Layout
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
please change this than try
here is xml with with out resources
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="vertical">
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="430dp"
android:fadingEdge="none">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:background="#drawable/splash_screen_large_long_land"
android:orientation="vertical" android:id="#+id/searchjobslayout">
<ImageView android:id="#+id/homeimage_one"
android:layout_height="wrap_content" android:layout_gravity="center_horizontal"
android:layout_width="fill_parent"></ImageView>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="vertical">
<TextView android:id="#+id/keywords" android:text="Search by keyword:"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textSize="14sp" android:textStyle="bold" android:textColor="#000000"
android:layout_marginLeft="10dp"></TextView>
<EditText android:id="#+id/keywordsedit" android:hint=" Enter KeyWords"
android:layout_width="fill_parent" android:layout_height="32dp"
android:layout_marginLeft="10dp" android:layout_marginRight="10dp"
android:textSize="14sp" android:layout_marginTop="5dp"
android:textColorHint="#FFFFFF" android:paddingLeft="10dp"
android:textColor="#000000"></EditText>
<Button android:id="#+id/search" android:text="Search"
android:layout_width="fill_parent" android:layout_height="35dp"
android:textColor="#FFFFFF" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" android:layout_marginTop="5dp"
android:textSize="20sp"></Button>
<TextView android:id="#+id/browseby" android:text="Browse by:"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textSize="14sp" android:textStyle="bold" android:textColor="#000000"
android:layout_marginLeft="10dp" android:paddingTop="10dp"></TextView>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="fill_parent"
android:layout_height="wrap_content">
<Button android:id="#+id/jobsbycity" android:text="City"
android:layout_width="fill_parent" android:layout_height="30dp"
android:textColor="#FFFFFF" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" android:layout_marginTop="5dp"
android:textStyle="bold" android:textSize="15sp"></Button>
<Button android:id="#+id/jobsbytype" android:text="Category"
android:layout_width="fill_parent" android:layout_height="30dp"
android:textColor="#FFFFFF" android:layout_below="#id/jobsbycity"
android:layout_marginLeft="10dp" android:layout_marginRight="10dp"
android:textStyle="bold" android:layout_marginTop="5dp"
android:textSize="15sp"></Button>
<TextView android:id="#+id/signin" android:text="Signed in as"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textSize="12sp" android:textColor="#000000"
android:layout_centerInParent="true" android:gravity="center_horizontal"
android:layout_below="#id/jobsbytype" android:paddingTop="10dp"></TextView>
<TextView android:id="#+id/signinas" android:text="mail_id"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textSize="12sp" android:layout_centerInParent="true"
android:textColor="#000000" android:gravity="center_horizontal"
android:layout_below="#id/signin" android:paddingTop="5dp"></TextView>
<TextView android:id="#+id/logout" android:text="Sign out"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textSize="13sp" android:gravity="center_vertical"
android:textColor="#000000" android:layout_below="#id/signinas"
android:layout_centerInParent="true" android:layout_marginTop="20dp"
android:textStyle="bold"></TextView>
</RelativeLayout>
</LinearLayout>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</ScrollView>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_gravity="bottom">
<Button android:id="#+id/jobs" android:text="About Us"
android:layout_width="100dp" android:layout_height="fill_parent"
android:background="#android:color/transparent"
android:layout_alignParentBottom="true" android:textStyle="bold"
android:textSize="12.5sp"></Button>
<Button android:id="#+id/aboutus" android:text="Value"
android:layout_width="100dp" android:layout_height="fill_parent"
android:layout_toRightOf="#id/jobs" android:background="#android:color/transparent"
android:layout_centerHorizontal="true" android:layout_centerVertical="true"
android:layout_alignParentBottom="true" android:layout_marginLeft="10dp"
android:textStyle="bold" android:textSize="12.5sp"></Button>
<Button android:id="#+id/benefits" android:text="History"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_toRightOf="#id/aboutus" android:background="#android:color/transparent"
android:layout_centerVertical="true"
android:layout_alignParentBottom="true" android:textStyle="bold"
android:textSize="12.5sp"></Button>
</RelativeLayout>