I am having a lot of trouble with the keypad not showing up.
I have a simple layout with all number EditText views - but (a) no keypad shows up for the first EditText field and then only the alpha pad shows up for the remaining ones. Is this a bug.
Here's the layout file:
<?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:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/lbBOS_previous"
android:layout_height="wrap_content"
android:layout_width="200dp"
android:paddingLeft="5dip"
android:paddingBottom="10dip"
android:text="#string/empties_bos_before"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<EditText
android:id="#+id/etBOS_previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:enabled="false"
android:focusable="false"
android:ems="10"
android:inputType="number" >
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/lbBottleSales"
android:layout_height="wrap_content"
android:layout_width="200dp"
android:paddingLeft="5dip"
android:paddingBottom="10dip"
android:text="#string/empties_bottleSales"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<EditText
android:id="#+id/etBottlesBought"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:enabled="false"
android:focusable="false"
android:ems="10"
android:inputType="number" >
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/lbEmpties"
android:layout_height="wrap_content"
android:paddingLeft="5dip"
android:layout_width="200dp"
android:paddingBottom="10dip"
android:text="#string/empties_pickup"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<EditText
android:id="#+id/etEmptiesPU"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:ems="10"
android:inputType="number" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/lbBOS_after"
android:layout_height="wrap_content"
android:layout_width="200dp"
android:paddingLeft="5dip"
android:paddingBottom="10dip"
android:text="#string/empties_bos_after"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<EditText
android:id="#+id/etBOSAfter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:ems="10"
android:inputType="number" >
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/lbCoolers"
android:layout_height="wrap_content"
android:layout_width="200dp"
android:paddingLeft="5dip"
android:paddingBottom="10dip"
android:text="#string/empties_coolers"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<EditText
android:id="#+id/etCoolersPU"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:ems="10"
android:inputType="number" >
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/lbracks"
android:layout_height="wrap_content"
android:layout_width="200dp"
android:paddingLeft="5dip"
android:paddingBottom="10dip"
android:text="#string/empties_racks"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<EditText
android:id="#+id/etRacksPU"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:ems="10"
android:inputType="number" >
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/lbemptiesWarning"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:paddingLeft="5dip"
android:paddingBottom="10dip"
android:text="#string/empties_saveWarning"
android:textSize="10sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom">
<Button
android:id="#+id/cmdDoneEmpties"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/cmd_done" />
</LinearLayout>
</LinearLayout>
You have set android:enabled to false one the first two EditText's, and on the other ones you have explicitly asked it to only show the numberpad, by specifying android:inputType="number". So the behavior is totally correct.
Edit: Ahh sorry misread your question a bit. To actually have the number pad showing up you have to target Android 1.5 and up. You should also be able to limit what characters are shown by doing something like this:
<EditText
android:inputType="phone"
android:digits="1234567890"
...
/>
Related
![enter image description here][1]In android we Create a RetailerRegistration form when softkeyboard open then bottom field are hide so we use on scrollview but when we use scrollview and click on edittext then softkeyboard open and whole screen turn on black how to resolve it please suggest
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff">
<LinearLayout
android:orientation="vertical"
android:minHeight="40px"
android:layout_width="match_parent"
android:layout_height="1.0dp"
android:id="#+id/linearLayout1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="#+id/linearLayout2">
<TextView
android:text="Retailer Name"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:id="#+id/textViewretailerName"
android:gravity="left"
android:cacheColorHint="#00000000"
style="#style/TextView_Small" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/editTextretailername"
android:gravity="left"
style="#style/EditText_Small2"
android:maxLength="30"
android:inputType="textCapCharacters"
android:editable="true" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="#+id/linearLayout18">
<TextView
android:text="Mobile No."
android:layout_width="110dp"
android:layout_height="wrap_content"
android:id="#+id/textViewretailerMobileNo"
android:gravity="left"
android:cacheColorHint="#00000000"
style="#style/TextView_Small" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/editTextretailerMobile"
android:gravity="left"
style="#style/EditText_Small2"
android:maxLength="10"
android:inputType="number"
android:editable="true" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="#+id/linearLayout3">
<TextView
android:text="Address"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:id="#+id/textViewretailerAddress"
android:gravity="left"
android:cacheColorHint="#00000000"
style="#style/TextView_Small" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/editTextretaileraddress1"
android:gravity="left"
android:minLines="2"
style="#style/EditText_Small2"
android:maxLength="100"
android:inputType="textCapCharacters"
android:editable="true" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="#+id/linearLayout3">
<TextView
android:text=""
android:layout_width="110dp"
android:layout_height="wrap_content"
android:id="#+id/textViewretailerAddress1"
android:gravity="left"
android:cacheColorHint="#00000000"
style="#style/TextView_Small" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/editTextretaileraddress2"
android:gravity="left"
android:minLines="2"
style="#style/EditText_Small2"
android:maxLength="100"
android:inputType="textCapCharacters"
android:editable="true" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="#+id/linearLayout4">
<TextView
android:text="PinCode"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:id="#+id/textViewretailerzipcode"
android:gravity="left"
android:cacheColorHint="#00000000"
style="#style/TextView_Small" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/editTextretailerzipcode"
android:gravity="left"
style="#style/EditText_Small2"
android:maxLength="6"
android:inputType="number"
android:editable="true" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="#+id/linearLayout5">
<TextView
android:text="Town"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:id="#+id/textViewretailercity"
android:gravity="left"
android:cacheColorHint="#00000000"
style="#style/TextView_Small" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/editTextretailercity"
android:gravity="left"
style="#style/EditText_Small2"
android:maxLength="50"
android:inputType="textCapCharacters"
android:editable="true" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="#+id/linearLayout6">
<TextView
android:text="District"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:id="#+id/textViewretailerdistrict"
android:gravity="left"
android:cacheColorHint="#00000000"
style="#style/TextView_Small" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/editTextretailerdistrict"
android:gravity="left"
style="#style/EditText_Small2"
android:maxLength="50"
android:inputType="textCapCharacters"
android:editable="false" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="#+id/linearLayout7">
<TextView
android:text="State"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:id="#+id/textViewretailerstate"
android:gravity="left"
android:cacheColorHint="#00000000"
style="#style/TextView_Small" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/editTextretailerState"
android:gravity="left"
style="#style/EditText_Small2"
android:maxLength="50"
android:inputType="textCapCharacters"
android:editable="false" />
</LinearLayout>
</LinearLayout>
</ScrollView>
try this Link for screenshot
http://i.stack.imgur.com/13vOw.png
I am not sure but it works fine for me.
Make your main Layout Relative "Relative Layout".
and Inside this Layout add your "Scroll View".
I have a LinearLayout consisting of 3 LinearLayout's consisting of 2 TextView's and an EditText. When I add a hint to the third EditText I end up with a lot of whitespace between the 2nd and 3rd TextViews and also after the 3rd.
Code and images are below. What could be causing this?
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:id="#+id/self"
>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/name"
android:layout_marginLeft="5dp"
android:padding="5dp"
android:textSize="22sp"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Sample Name"
android:padding="5dp"
android:id="#+id/self_name_show"
android:textSize="22sp"
android:textColor="#0099CC"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:id="#+id/self_name_edit"
android:inputType="text"
android:hint="#string/enter_name"
/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/address"
android:layout_marginLeft="5dp"
android:padding="5dp"
android:textSize="22sp"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Sample Address"
android:padding="5dp"
android:id="#+id/self_address_show"
android:textSize="22sp"
android:textColor="#0099CC"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/self_address_edit"
android:visibility="gone"
android:inputType="text"
android:hint="#string/enter_address"
/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/phone"
android:layout_marginLeft="5dp"
android:padding="5dp"
android:autoLink="all"
android:textSize="22sp"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Sample Phone"
android:padding="5dp"
android:id="#+id/self_phone_show"
android:textSize="22sp"
android:textColor="#0099CC"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/self_phone_edit"
android:phoneNumber="true"
android:hint="#string/enter_phone"
/>
</LinearLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="#string/edit"
android:id="#+id/edit_self_button"
android:onClick="toggleSelfEdit"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="#string/update"
android:id="#+id/update_self_button"
android:visibility="gone"
/>
</LinearLayout>
Without hint:
With hint:
I think you forgot writing the android:visibility="gone" at the third edittext. I tried your xml and when I put visibility="gone" inside the edittext your xml looks like the first screenshot :)
I have the layout below, which when the software keyboard opens the bottom buttons move up and all get squished together.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:background="#ffffff">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:orientation="vertical"
android:padding="10dip" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="70dp"
android:src="#drawable/banner" />
<TextView
android:id="#+id/erroremail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="TEST"
android:textColor="#D80000" />
<EditText
android:id="#+id/email_logout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:inputType="textEmailAddress"
android:singleLine="true"
android:hint="Email address" >
<requestFocus />
</EditText>
<EditText
android:id="#+id/password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:password="true"
android:singleLine="true"
android:hint="Password" />
<Button
android:id="#+id/btnLogin"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:background="#color/background"
android:height="50dp"
android:text="Sign In"
android:textColor="#FFF"
android:textSize="16sp" />
<TextView
android:id="#+id/forgottenpassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingTop="10dp"
android:text="Forgotten password?" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dip"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="10dp"
android:orientation="vertical" >
<Button
android:id="#+id/fbshare"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:background="#3B5998"
android:drawableLeft="#drawable/facebooklogo"
android:height="50dp"
android:text="Log in with Facebook"
android:textColor="#FFF"
android:textSize="16sp" />
<TextView
android:id="#+id/get_started"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:background="#color/background"
android:gravity="center"
android:height="50dp"
android:text="Sign Up"
android:textColor="#fff"
android:textSize="16sp" />
</LinearLayout>
</RelativeLayout>
</ScrollView>
I have set android:windowSoftInputMode="adjustPan" in the manifest but this does not seem to have changed anything.
Testing on my Note 3 with android 4.3
Is there another way I need to force the view to not get pushed together and just have the software keyboard lay on top of the view
Please put android:windowSoftInputMode="stateAlwaysHidden|adjustPan" inside activity tag of manifest file
I have the following layout in my application
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TableRow>
<TextView
android:text="Username"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:id="#+id/username"
android:inputType="textEmailAddress"
/>
</TableRow>
<TableRow>
<TextView
android:text="Password"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:id="#+id/password"
android:inputType="textPassword"
/>
</TableRow>
<!-- ADDED NEW -->
<TableRow
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/savePwd"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:text="Save Password (In encrypted clear text)"
/>
</LinearLayout>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<TextView
android:text="Please Log In"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/message_login"/>
</TableRow>
<TableRow android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="bottom|center">
<Button
android:id="#+id/btn_login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Log In"/>
</TableRow>
</TableLayout>
The problem here is around the EditTexts. The TextViews expand to match the LinearLayout. This is not what I would like. I would like it to behave like the button below it (which doesn't expand the TextViews). Here is a screenshot...
Before...
After
Since you are using weights on the Edit Texts, remove the android:layout_width="wrap_content" from the Edit Texts, and the weight will be extended how you like.
This Rows for the TextViews/EditText should look like this instead....
<TableRow>
<TextView
android:text="Password"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0" />
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2.0"
android:id="#+id/password"
android:inputType="textPassword"
/>
</TableRow>
// try this
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="5dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">
<TextView
android:text="Username"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="#+id/username"
android:layout_marginLeft="5dp"
android:inputType="textEmailAddress"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">
<TextView
android:text="Password"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="#+id/password"
android:layout_marginLeft="5dp"
android:inputType="textPassword"/>
</LinearLayout>
<!-- ADDED NEW -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/savePwd"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="5dp"
android:text="Save Password (In encrypted clear text)"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">
<TextView
android:text="Please Log In"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/message_login"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:gravity="bottom|center"
android:layout_marginTop="5dp"
android:layout_weight="1">
<Button
android:id="#+id/btn_login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Log In"/>
</LinearLayout>
</LinearLayout>
Can anyone help me in giving the gravity for four buttons developed in a vertical linear layout which is again in horizontal linear layout with progress bar. I need the whole buttons and the progress bar in the bottom of my screen. Please help me out.
Thanks in advance
<?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"
>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<Button
android:id="#+id/play"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<Button
android:id="#+id/pause"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="#+id/back"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="#+id/fwd"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<ProgressBar
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyleHorizontal"
android:id="#+id/progressbar_Horizontal"
/>
</LinearLayout>
Hi # srinivas.
gravity for four buttons developed in a vertical linear layout which is again in horizontal
linear layout with progress bar, try out by this xml code.. its must helpful to you...
<?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="#android:color/white"
android:orientation="vertical" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:weightSum="3" >
<TextView
android:id="#+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="First Name"
android:textColor="#000000" />
<EditText
android:id="#+id/firstName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#android:drawable/editbox_background_normal"
android:ems="10"
android:hint="First Name"
android:maxLength="20"
android:singleLine="true"
android:textColor="#000000" >
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:weightSum="3" >
<TextView
android:id="#+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="Last Name"
android:textColor="#000000" />
<EditText
android:id="#+id/lastName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#android:drawable/editbox_background_normal"
android:ems="10"
android:hint="Last Name"
android:maxLength="20"
android:singleLine="true"
android:textColor="#000000" >
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:weightSum="3" >
<TextView
android:id="#+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="UserName"
android:textColor="#000000" />
<EditText
android:id="#+id/un"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#android:drawable/editbox_background_normal"
android:ems="10"
android:hint="User Name"
android:maxLength="20"
android:singleLine="true"
android:textColor="#000000" >
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:weightSum="3" >
<TextView
android:id="#+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="Password"
android:textColor="#000000" />
<EditText
android:id="#+id/pw"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#android:drawable/editbox_background_normal"
android:ems="10"
android:hint="Password"
android:maxLength="20"
android:password="true"
android:singleLine="true"
android:textColor="#000000" >
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:weightSum="3" >
<TextView
android:id="#+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="Email"
android:textColor="#000000" />
<EditText
android:id="#+id/email"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#android:drawable/editbox_background_normal"
android:ems="10"
android:hint="Email"
android:maxLength="20"
android:singleLine="true"
android:textColor="#000000" >
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:weightSum="3" >
<TextView
android:id="#+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="Phone No."
android:textColor="#000000" />
<EditText
android:id="#+id/phoneNum"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#android:drawable/editbox_background_normal"
android:ems="10"
android:hint="Phone Number"
android:inputType="number"
android:maxLength="20"
android:singleLine="true"
android:textColor="#000000" >
</EditText>
</LinearLayout>
<Button
android:id="#+id/push_button"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:background="#drawable/rounded_button"
android:text="Send Data"
android:textColor="#ffffff" />
</LinearLayout>
</ScrollView>
</LinearLayout>
android:gravity="bottom"
add this line to both your vertical as well as horizontal linear layout
I guess this was the answer you were looking for
Replace with following code
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:id="#+id/btnLayout"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/progressbar_Horizontal"
>
<Button
android:id="#+id/play"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<Button
android:id="#+id/pause"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="#+id/back"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="#+id/fwd"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<ProgressBar
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyleHorizontal"
android:id="#+id/progressbar_Horizontal"
android:layout_alignParentBottom="true"
/>
</RelativeLayout>