So I've completed an early version of my Android app and begun testing on various devices. I'm finding my nested LinearLayouts aren't sufficient for my purposes so I'm trying to convert the nested LinearLayouts to a RelativeLayout. Below is my starting point:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
tools:context=".LoginActivity">
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="#drawable/backgroundhomescreen"
android:scaleType="fitXY" />
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="35dp">
<LinearLayout
android:orientation="vertical"
android:padding="10dp">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
android:paddingBottom="3dp"
android:layout_marginBottom="10dp">
<EditText
android:id="#+id/login_txt_Username"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#layout/textboxlogin"
android:hint="Username or Email"
android:inputType="textEmailAddress"
android:scrollbars="none"
android:textColor="#fff"
android:textColorHint="#ddd" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
android:paddingBottom="3dp"
android:paddingTop="3dp"
android:layout_marginBottom="10dp">
<EditText
android:id="#+id/login_txt_Password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#layout/textboxlogin"
android:hint="Password"
android:inputType="textPassword"
android:maxLines="1"
android:textColorHint="#ddd" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
android:paddingBottom="3dp"
android:paddingTop="3dp">
<Button
android:id="#+id/login_btn_submit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="SIGN IN"
android:textColor="#fff"
android:textSize="25dp"
android:textStyle="bold"
android:typeface="normal"
android:background="#layout/buttonsigninbackground" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingTop="3dp">
<TextView
android:id="#+id/login_txt_or"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="- or -"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="25dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
android:paddingBottom="15dp"
android:paddingTop="3dp">
<Button
android:id="#+id/login_btn_navCreateAccount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#layout/buttoncreateaccountbackground"
android:text="CREATE AN ACCOUNT"
android:textColor="#fff"
android:textSize="25dp"
android:textStyle="bold"
android:typeface="normal" />
</LinearLayout>
</LinearLayout>
</TableLayout>
</RelativeLayout>
And here is where I've gotten so far but with some issues - even after following this tutorial - Visual Guide to RelativeLayout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:context=".LoginActivity">
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="#drawable/backgroundhomescreen"
android:scaleType="fitXY" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<EditText
android:id="#+id/login_txt_Username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#layout/textboxlogin"
android:hint="Username"
android:layout_centerHorizontal="true"
android:inputType="textEmailAddress"
android:maxLines="1"
android:scrollbars="none"
android:textColor="#fff"
android:textColorHint="#ddd" />
<EditText
android:id="#+id/login_txt_Password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#layout/textboxlogin"
android:hint="Password"
android:layout_centerHorizontal="true"
android:inputType="textPassword"
android:maxLines="1"
android:scrollbars="none"
android:textColor="#fff"
android:textColorHint="#ddd"
android:layout_below="#id/login_txt_Username"
/>
<Button
android:id="#+id/login_btn_submit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:text="SIGN IN"
android:layout_centerHorizontal="true"
android:textColor="#fff"
android:textSize="25dp"
android:textStyle="bold"
android:typeface="normal"
android:background="#layout/buttonsigninbackground" />
<TextView
android:id="#+id/login_txt_or"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="- or -"
android:layout_centerHorizontal="true"
android:layout_above="#+id/login_btn_navCreateAccount"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="25dp"
android:textStyle="bold" />
<Button
android:id="#id/login_btn_navCreateAccount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#layout/buttoncreateaccountbackground"
android:text="CREATE AN ACCOUNT"
android:textColor="#fff"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="25dp"
android:textSize="25dp"
android:textStyle="bold"
android:typeface="normal" />
</RelativeLayout>
</RelativeLayout>
Ultimately I need a relative layout that's bottom aligned so I can place other views just above the previous. In my second code sample above, textview 'login_txt_or' that references login_btn_navCreateAccount seems to be ignored.
Any clue to why this is? If it's of any use, I'm using Xamarin.Android 4.10.1 in Xamarin Studio.
This is what I ended up with
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/activity_login_relativeLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="#drawable/backgroundgameplaying"
android:scaleType="fitXY" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="bottom"
android:layout_marginBottom="45dp">
<TextView
android:id="#+id/login_tv_error"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="15dp"
android:textColor="#f00" />
<EditText
android:id="#+id/login_txt_Username"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="25dp"
android:background="#layout/textboxlogin"
android:hint="Username"
android:layout_centerHorizontal="true"
android:inputType="textEmailAddress"
android:maxLines="1"
android:scrollbars="none"
android:textColor="#fff"
android:textColorHint="#ddd"
android:layout_below="#id/login_tv_error" />
<EditText
android:id="#+id/login_txt_Password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="25dp"
android:background="#layout/textboxlogin"
android:hint="Password"
android:layout_centerHorizontal="true"
android:inputType="textPassword"
android:maxLines="1"
android:scrollbars="none"
android:textColor="#fff"
android:textColorHint="#ddd"
android:layout_below="#id/login_txt_Username" />
<Button
android:id="#+id/login_btn_submit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/login_txt_Password"
android:layout_centerHorizontal="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="25dp"
android:textColor="#fff"
android:textSize="25dp"
android:textStyle="bold"
android:typeface="normal"
android:background="#layout/buttonsigninbackground"
android:text="SIGN IN" />
<TextView
android:id="#+id/loginTxtOr"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/login_btn_submit"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_marginBottom="25dp"
android:textSize="25dp"
android:textStyle="bold|italic"
android:text="- or -" />
<Button
android:id="#+id/login_btn_navCreateAccount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_alignParentRight="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="25dp"
android:layout_below="#id/loginTxtOr"
android:background="#layout/buttoncreateaccountbackground"
android:textColor="#fff"
android:textSize="25dp"
android:textStyle="bold"
android:typeface="normal"
android:text="CREATE AN ACCOUNT" />
</RelativeLayout>
</RelativeLayout>
Related
I have a App with Login Layout So I have added 2 Buttons Save,Cancel
this is my XML Layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/header"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#303F9F"
android:layout_alignParentTop="true"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="My App Login"
android:id="#+id/ota"
android:textColor="#FFF"
android:textStyle="bold"
android:layout_gravity="center_horizontal"/>
</RelativeLayout>
<ScrollView
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_above="#id/footer"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="15dp"
android:layout_below="#id/header">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView android:textAppearance="?android:textAppearanceSmall"
android:gravity="bottom|left|center"
android:id="#+id/tt5"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="#string/ui"
android:textSize="14sp"
android:layout_below="#+id/et3"
android:layout_weight="0.1"
android:layout_marginTop="10dp"/>
<EditText android:id="#+id/et4"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginLeft="5.0dip"
android:layout_marginBottom="5.0dip"
android:maxLines="1"
android:hint="Enter User Name"
android:layout_weight="0.1"
android:layout_below="#+id/tt5"
android:inputType="text"/>
<TextView android:textAppearance="?android:textAppearanceSmall"
android:gravity="bottom|left|center"
android:id="#+id/tt6"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="#string/pw"
android:textSize="14sp"
android:layout_below="#+id/et4"
android:layout_weight="0.1"
android:layout_marginTop="10dp"/>
<EditText android:id="#+id/et5"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginLeft="5.0dip"
android:layout_marginBottom="5.0dip"
android:maxLines="1"
android:hint="Enter Password"
android:layout_weight="0.1"
android:layout_below="#+id/tt6"
android:inputType="textPassword"/>
<Button android:id="#+id/save"
android:layout_width="fill_parent"
android:layout_height="0.0dip"
android:layout_marginBottom="5.0dip"
android:text="#string/save"
android:textAlignment="center"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Large"
android:background="#drawable/selector_btn"
android:drawableLeft="#android:drawable/ic_menu_save"
android:layout_weight="0.1"
android:layout_marginTop="50dp"
android:textColor="#color/text_white"/>
<Button android:id="#+id/cancel"
android:layout_width="fill_parent"
android:layout_height="0.0dip"
android:text="#string/cancel"
android:textAlignment="center"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Large"
android:background="#drawable/c_selector_btn"
android:drawableLeft="#android:drawable/ic_menu_close_clear_cancel"
android:layout_weight="0.1"
android:textColor="#color/text_white"/>
</LinearLayout>
</ScrollView>
</RelativeLayout>
Here its working fine for android 5,6 but in android 7 buttons are not showing in emulator,xml,Real Device
But its not working in android 7
its showing like this
can any one suggest me what I am missing for android 7 in android XML.. I am using same in android 5,6 its worked but its not showing in 7
<Button android:id="#+id/save"
android:layout_width="match_parenr"
android:layout_height="wrap_content"
android:layout_marginBottom="5.0dip"
android:text="#string/save"
android:textAlignment="center"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Large"
android:background="#drawable/selector_btn"
android:drawableLeft="#android:drawable/ic_menu_save"
android:layout_marginTop="50dp"
android:textColor="#color/text_white"/>
You should give height of button to wrap_content
You can try bellow like..
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<!--Header Hear-->
<!-- Content Here -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight=".1"
android:background="#FFFFFF"
android:orientation="vertical" >
<TextView
android:id="#+id/tv_message_reset_new_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginRight="5dp"
android:layout_marginTop="10dp" />
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView android:textAppearance="?android:textAppearanceSmall"
android:gravity="bottom|left|center"
android:id="#+id/tt5"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="User Id"
android:textSize="14sp"
android:layout_below="#+id/et3"
android:layout_weight="0.1"
android:layout_marginTop="10dp"/>
<EditText android:id="#+id/et4"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginLeft="5.0dip"
android:layout_marginBottom="5.0dip"
android:maxLines="1"
android:hint="Enter User Name"
android:layout_weight="0.1"
android:layout_below="#+id/tt5"
android:inputType="text"/>
<TextView android:textAppearance="?android:textAppearanceSmall"
android:gravity="bottom|left|center"
android:id="#+id/tt6"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="password"
android:textSize="14sp"
android:layout_below="#+id/et4"
android:layout_weight="0.1"
android:layout_marginTop="10dp"/>
<EditText android:id="#+id/et5"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginLeft="5.0dip"
android:layout_marginBottom="5.0dip"
android:maxLines="1"
android:hint="Enter Password"
android:layout_weight="0.1"
android:layout_below="#+id/tt6"
android:inputType="textPassword"/>
<Button android:id="#+id/save"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5.0dip"
android:text="save"
android:textAlignment="center"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Large"
android:background="#97d1ea"
android:drawableLeft="#android:drawable/ic_menu_save"
android:layout_weight="0.1"
android:layout_marginTop="50dp"
android:textColor="#ffffff"/>
<Button android:id="#+id/cancel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="cancel"
android:textAlignment="center"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Large"
android:background="#97d1ea"
android:drawableLeft="#android:drawable/ic_menu_close_clear_cancel"
android:layout_weight="0.1"
android:textColor="#ffffff"/>
</LinearLayout>
</ScrollView>
</LinearLayout>
<!--Footer Hear-->
</LinearLayout>
I am trying to create a layout it was working good yesterday but today I am opened the xml view all the text of controls is right aligned it happen with every screen.
<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:background="#drawable/bg"
>
<RelativeLayout
android:id="#+id/layout_logo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/layout_loginArea"
android:gravity="center_horizontal" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/logo" />
</RelativeLayout>
<LinearLayout
android:id="#+id/layout_loginArea"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:orientation="vertical"
android:padding="10dp" >
<EditText
android:id="#+id/edit_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/txt_box"
android:hint="#string/usernamehint"
android:inputType="textPersonName"
android:paddingBottom="4dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:paddingTop="4dp"
android:textColor="#ffffff"
android:textColorHint="#ffffff" />
<EditText
android:id="#+id/edit_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:background="#drawable/txt_box"
android:hint="#string/passwordhint"
android:inputType="textPassword"
android:padding="4dp"
android:paddingBottom="4dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:paddingTop="4dp"
android:textColor="#ffffff"
android:textColorHint="#ffffff" />
<Button
android:id="#+id/button_login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="3dp"
android:background="#drawable/signin_button"
android:text="#string/loginButtonText" />
<TextView
android:id="#+id/txt_forgotpassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center_horizontal"
android:text="#string/forgotpassword" />
</LinearLayout>
<LinearLayout
android:id="#+id/layout_createAccount"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center"
android:orientation="vertical"
android:padding="10dp" >
<Button
android:id="#+id/button_facebook"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#drawable/facebook_button"
android:text="#string/createaccount" />
<Button
android:id="#+id/button_createAccount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/create_account" />
</LinearLayout>
</RelativeLayout>
Set the width of view and make view gravity="center"
<LinearLayout
android:id="#+id/layout_createAccount"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical"
android:padding="10dp" >
<Button
android:id="#+id/button_facebook"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#color/app_bg"
android:gravity="center"
android:text="createaccount" />
<Button
android:id="#+id/button_createAccount"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:background="#color/app_bg"
android:gravity="center"
android:text="createaccount" />
</LinearLayout>
I have the following xml layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/textHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:padding="10dp"
android:textStyle="bold"
android:text="#string/form_header"
android:textSize="10pt" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
android:layout_below="#+id/textHeader">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textComp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:padding="10dp"
android:textColor="#color/red"
android:text="#string/form_comp"
android:textSize="7pt" />
<RelativeLayout
android:id="#+id/relativeLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textComp" >
<TextView
android:id="#+id/textTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:padding="10dip"
android:text="#string/form_title"
android:textSize="7pt" />
<Spinner
android:id="#+id/title_spinner"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/textTitle"
android:focusable="true"
android:padding="10dip" />
<TextView
android:id="#+id/textFname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textTitle"
android:gravity="center_horizontal"
android:padding="10dip"
android:text="#string/form_fname"
android:textSize="7pt" />
<EditText
android:id="#+id/editFname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:layout_below="#+id/textTitle"
android:layout_toRightOf="#id/textFname"
android:ems="10"
android:maxLength="15" />
<TextView
android:id="#+id/textLname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textFname"
android:gravity="center_horizontal"
android:padding="10dip"
android:text="#string/form_lname"
android:textSize="7pt" />
<EditText
android:id="#+id/editLname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:layout_below="#+id/textFname"
android:layout_toRightOf="#id/textLname"
android:ems="10"
android:maxLength="15" />
<TextView
android:id="#+id/textTel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textLname"
android:gravity="center_horizontal"
android:padding="10dip"
android:text="#string/form_tel"
android:textSize="7pt" />
<EditText
android:id="#+id/editTel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:layout_below="#+id/textLname"
android:layout_toRightOf="#id/textTel"
android:ems="10"
android:maxLength="15" />
<TextView
android:id="#+id/textEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textTel"
android:gravity="center_horizontal"
android:padding="10dip"
android:text="#string/form_email"
android:textSize="7pt" />
<EditText
android:id="#+id/editEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:layout_below="#+id/textTel"
android:layout_toRightOf="#id/textEmail"
android:ems="10"
android:maxLength="25" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/relativeLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/relativeLayout1" >
<TextView
android:id="#+id/textDep"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:padding="10dip"
android:text="#string/form_dep"
android:textSize="7pt" />
<EditText
android:id="#+id/editDep"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:layout_toRightOf="#id/textDep"
android:ems="10"
android:maxLength="25" />
<TextView
android:id="#+id/textDest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:padding="10dip"
android:text="#string/form_dest"
android:layout_below="#+id/textDep"
android:textSize="7pt" />
<EditText
android:id="#+id/editDest"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:layout_toRightOf="#id/textDest"
android:layout_below="#+id/textDep"
android:ems="10"
android:maxLength="25" />
<TextView
android:id="#+id/textNpersons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:padding="10dip"
android:text="#string/form_npersons"
android:layout_below="#+id/editDest"
android:textSize="7pt" />
<EditText
android:id="#+id/editNpersons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:layout_toRightOf="#id/textNpersons"
android:layout_below="#+id/editDest"
android:ems="10"
android:maxLength="3" />
<TextView
android:id="#+id/textDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:padding="10dip"
android:text="#string/form_date"
android:layout_below="#+id/textNpersons"
android:textSize="7pt" />
<Spinner
android:id="#+id/spYear"
android:layout_width="85dp"
android:layout_height="wrap_content"
android:layout_below="#+id/textNpersons"
android:layout_toRightOf="#id/textDate"/>
<Spinner
android:id="#+id/spMonth"
android:layout_width="85dp"
android:layout_height="wrap_content"
android:layout_below="#+id/textNpersons"
android:layout_toRightOf="#id/spYear"/>
<Spinner
android:id="#+id/spDay"
android:layout_width="85dp"
android:layout_height="wrap_content"
android:layout_below="#+id/textNpersons"
android:layout_toRightOf="#id/spMonth"/>
<TextView
android:id="#+id/textTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:padding="10dip"
android:text="#string/form_time"
android:layout_below="#+id/spDay"
android:textSize="7pt" />
<Spinner
android:id="#+id/spTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:layout_toRightOf="#id/textTime"
android:layout_below="#+id/spDay"/>
<TextView
android:id="#+id/textComms"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:padding="10dip"
android:text="#string/form_comments"
android:layout_below="#+id/spTime"
android:textSize="7pt" />
<EditText
android:id="#+id/editComms"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:inputType="textMultiLine"
android:lines="2"
android:minLines="2"
android:gravity="top|left"
android:maxLines="5"
android:layout_below="#+id/spTime"
android:layout_toRightOf="#id/textComms"
android:scrollbars="vertical"/>
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/editComms"
android:layout_centerHorizontal="true"
android:text="#string/form_snd_button" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
</RelativeLayout>
The ScrollView scrolls fine; however, the last button (#+id/button1) is not shown.
I've tried several combinations with match_parent and wrap_content for the contained layouts but with no luck.
Any ideas?
Thanks in advance.
Edit: Actually I'm writing my app so as to work in both tablets and phones. The above layout that belongs to a fragment works fine for phones.
In the case of tablets, the specific button is not shown. The above layout is attached to the Framelayout:aboutusdet shown in the code below:
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="#android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.gms.ads.AdView android:id="#+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="SMART_BANNER"
ads:adUnitId="#string/UnitId"/>
<FrameLayout
android:id="#+id/mainfrg"
android:layout_width="500dp"
android:layout_height="wrap_content"
android:layout_below="#+id/adView"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="15dp"
android:layout_alignParentLeft="true"
/>
<FrameLayout
android:id="#+id/aboutusdet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/mainfrg"
android:layout_below="#+id/adView"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="15dp"
/>
<FrameLayout android:id="#android:id/tabcontent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/mainfrg" />
<TabWidget android:id="#android:id/tabs"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true" />
</RelativeLayout>
</TabHost>
I have made a simple form in android and have put all the form contents in that scrollView but my scrollView doesnt working ,It not scrolls down,My code is as below:
main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<View
android:id="#+id/line"
android:layout_width="fill_parent"
android:layout_height="7dp"
android:layout_alignParentTop="true"
android:background="#4fc1e9" />
<TextView
android:id="#+id/title_reg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/line"
android:gravity="center"
android:padding="13dp"
android:text="#string/title_registration"
android:textColor="#cecece"
android:textSize="16dp"
android:textStyle="bold" />
<RelativeLayout
android:id="#+id/btn_qq_login"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/title_reg" >
<TextView
android:id="#+id/tv_qq_login"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#5d9cec"
android:gravity="center"
android:padding="12dp"
android:text="#string/qq_login"
android:textColor="#ffffff"
android:textSize="18dp"
android:textStyle="bold" />
</RelativeLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="#+id/btn_qq_login"
android:fillViewport="true" >
<RelativeLayout
android:id="#+id/rl_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/txt_or"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="#string/or"
android:textColor="#cecece"
android:textSize="16dp"
android:textStyle="bold" />
<TextView
android:id="#+id/txt_reg_new_account"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_or"
android:autoLink="web"
android:gravity="center"
android:text="#string/reg_new_account"
android:textColor="#cecece"
android:textColorLink="#cecece"
android:textSize="16dp"
android:textStyle="bold" />
<TextView
android:id="#+id/txt_ur_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_reg_new_account"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:text="#string/reg_name"
android:textColor="#cecece"
android:textSize="14dp" />
<EditText
android:id="#+id/et_txt_ur_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_ur_name"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="5dp"
android:background="#drawable/bg_editext"
android:hint="#string/hint_reg_name"
android:padding="8dp"
android:textColorHint="#cecece"
android:textSize="14dp" />
<TextView
android:id="#+id/txt_ur_email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/et_txt_ur_name"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:text="#string/reg_email"
android:textColor="#cecece"
android:textSize="14dp" />
<EditText
android:id="#+id/et_txt_ur_email"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_ur_email"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="5dp"
android:background="#drawable/bg_editext"
android:hint="#string/hint_reg_email"
android:padding="8dp"
android:textColorHint="#cecece"
android:textSize="14dp" />
<TextView
android:id="#+id/txt_ur_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/et_txt_ur_email"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:text="#string/reg_phone_number"
android:textColor="#cecece"
android:textSize="14dp" />
<EditText
android:id="#+id/et_txt_ur_phone"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_ur_phone"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="5dp"
android:background="#drawable/bg_editext"
android:hint="#string/hint_reg_phone_number"
android:padding="8dp"
android:textColorHint="#cecece"
android:textSize="14dp" />
<TextView
android:id="#+id/txt_ur_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/et_txt_ur_phone"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:text="#string/reg_pwd"
android:textColor="#cecece"
android:textSize="14dp" />
<EditText
android:id="#+id/et_txt_ur_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_ur_password"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="15dp"
android:background="#drawable/bg_editext"
android:hint="#string/hint_reg_pwd"
android:padding="8dp"
android:textColorHint="#cecece"
android:textSize="14dp" />
</RelativeLayout>
</ScrollView>
<RelativeLayout
android:id="#+id/reg_bottom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#f5f7f9"
android:paddingBottom="5dp" >
<Button
android:id="#+id/btn_register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
android:background="#drawable/btn_register"
android:gravity="center"
android:text="#string/btn_reg"
android:textColor="#ffffff" />
<TextView
android:id="#+id/txt_already_member"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/btn_register"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="#string/txt_already_member"
android:textColor="#babfc3"
android:textSize="12dp" />
<TextView
android:id="#+id/txt_already_login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/btn_register"
android:layout_centerHorizontal="true"
android:layout_marginLeft="3dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/txt_already_member"
android:autoLink="web"
android:text="#string/txt_already_login"
android:textColor="#3a91ea"
android:textColorLink="#cecece"
android:textSize="12dp" />
</RelativeLayout>
<ImageView
android:id="#+id/iv_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="47dp"
android:background="#drawable/qq" />
</RelativeLayout>
Please help me sort it out..Thank you
you have problem with ScrollView.you need to specify to the scroll view for scrolling.
just add below property in to ScrollView
android:layout_above="#+id/reg_bottom"
you need to bind your scroll view.
thanx.
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>