I have 5 horizontal linear layout is there. I aligned three edittext in a single linear layout. And I applied the weight field property 1 for all the editext. But in 1st and 3rd linear layout working perfectly with the property. Others are not working properly. Again in 5th horizontal linear layout have one spinner view, it was also creating the same problem. Then 4th line one addition linear layout available inside the horizontal layout, with one edittext and one imageview. It is also not fixing properly with weight property. I put layout code below.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_horizontal">
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/yellow" />
<TextView
android:id="#+id/sign_up"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Sign Up" />
</LinearLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp">
<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:orientation="horizontal" >
<EditText
android:id="#+id/f_name"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:maxLength="20"
android:textSize="18dp"
android:layout_weight="1"
android:inputType="textPersonName"
android:layout_marginRight="20dp"
android:hint="First Name"
android:background="#drawable/edittext_yellow_singleline" >
</EditText>
<EditText
android:id="#+id/l_name"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:maxLength="20"
android:textSize="18dp"
android:layout_weight="1"
android:inputType="textPersonName"
android:layout_marginRight="20dp"
android:hint="Last Name"
android:background="#drawable/edittext_yellow_singleline" />
<EditText
android:id="#+id/uname"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:maxLength="20"
android:textSize="18dp"
android:layout_weight="1"
android:inputType="textPersonName"
android:hint="Username *"
android:background="#drawable/edittext_yellow_singleline" />
</LinearLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="10dp"/>
<LinearLayout//this layout creating alignment issue. if I put extra space in hint nearly it was getting good view. But different screens wont work
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<EditText
android:id="#+id/phone"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:maxLength="12"
android:textSize="18dp"
android:layout_weight="1"
android:inputType="phone"
android:layout_marginRight="20dp"
android:hint="Phone"
android:background="#drawable/edittext_yellow_singleline" />
<EditText
android:id="#+id/plan_id"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:textSize="18dp"
android:layout_weight="1"
android:inputType="textPostalAddress"
android:layout_marginRight="20dp"
android:hint="Member Plan ID"
android:background="#drawable/edittext_yellow_singleline" />
<EditText
android:id="#+id/pass"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:maxLength="20"
android:textSize="18dp"
android:layout_weight="1"
android:inputType="textPassword"
android:hint="Password *"
android:background="#drawable/edittext_yellow_singleline" />
</LinearLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="10dp"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<EditText
android:id="#+id/address"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:maxLength="50"
android:textSize="18dp"
android:layout_weight="1"
android:inputType="textPostalAddress"
android:layout_marginRight="20dp"
android:hint="Address"
android:background="#drawable/edittext_yellow_singleline" />
<EditText
android:id="#+id/mobile"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:maxLength="10"
android:textSize="18dp"
android:layout_weight="1"
android:inputType="phone"
android:layout_marginRight="20dp"
android:hint="Mobile * "
android:background="#drawable/edittext_yellow_singleline" />
<EditText
android:id="#+id/email"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:maxLength="30"
android:textSize="18dp"
android:layout_weight="1"
android:inputType="textEmailAddress"
android:hint="Email * "
android:background="#drawable/edittext_yellow_singleline" />
</LinearLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="10dp"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<EditText
android:id="#+id/city"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:maxLength="30"
android:textSize="18dp"
android:layout_weight="1"
android:inputType="textPostalAddress"
android:layout_marginRight="20dp"
android:hint="City"
android:background="#drawable/edittext_yellow_singleline" />
<EditText
android:id="#+id/state"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:maxLength="30"
android:textSize="18dp"
android:layout_weight="1"
android:inputType="textPostalAddress"
android:layout_marginRight="20dp"
android:hint="State"
android:background="#drawable/edittext_yellow_singleline" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1">//tried this not worked
<EditText
android:id="#+id/dob"
android:layout_width="265dp"
android:layout_height="40dp"
android:maxLength="10"
android:textSize="18dp"
android:inputType="date"
android:hint="Date of Birth"
android:background="#drawable/edittext_yellow_singleline" />
<ImageButton
android:id="#+id/img_dob"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="#drawable/cal" />
</LinearLayout>
</LinearLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="10dp"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<EditText
android:id="#+id/country"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:textSize="18dp"
android:layout_weight="1"
android:inputType="textPostalAddress"
android:layout_marginRight="20dp"
android:hint="Country"
android:background="#drawable/edittext_yellow_singleline" />
<EditText
android:id="#+id/zipcode"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:maxLength="6"
android:textSize="18dp"
android:layout_weight="1"
android:inputType="number"
android:layout_marginRight="20dp"
android:hint="Zipcode "
android:background="#drawable/edittext_yellow_singleline" />
<Spinner
android:id="#+id/gender"
android:layout_width="305dp"//finally hard coded but it wont work for multiple screens
android:layout_height="40dp"
/>
</LinearLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="30dp"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal" >
<Button
android:id="#+id/ok"
android:layout_width="100dp"
android:layout_height="40dp"
android:gravity="center"
android:textSize="20dp"
android:text="Done"
android:background="#drawable/login_button_shape" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
If it won't work means, will the table layout give solution for this?
If I reduce the text inside the hint then also it was working fine in 2nd line. If I provide space for keeping same text length in with other edittext field which contains low text also not worked.
All your EditText should have:
android:layout_width="0dp"
And all LinearLayout should have:
android:weightsum="3"
Related
I am developing an android application. On the preview the view is presanting the way I have set it but when I run it on a device I am seeing spaces on it right and left side.
Screen shots are attached for the better understanding of the problem.
Below is the code of my layout.
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="------"
>
<!-- TODO: Update blank fragment layout -->
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="#+id/scrollView"
android:scrollbars="none"
android:layout_gravity="center">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#color/screen_background">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/telephone_number"
android:id="#+id/telephonNumberTextView"
android:phoneNumber="false"
android:textColor="#android:color/white"
android:layout_marginTop="10dp"
android:layout_marginBottom="5dp"
android:paddingLeft="2dp" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="phone"
android:ems="10"
android:id="#+id/phoneNumberEditText"
android:layout_weight="1"
android:clickable="true"
android:singleLine="true"
android:background="#drawable/edittext"
android:paddingLeft="4dp"
android:textAlignment="textStart" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/telephone_extension"
android:id="#+id/telephoneExtensionTextView"
android:layout_marginTop="10dp"
android:layout_gravity="left|center_vertical"
android:textColor="#android:color/white"
android:layout_marginBottom="5dp"
android:paddingLeft="2dp"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="phone"
android:ems="10"
android:id="#+id/telephoneExtensionEditText"
android:background="#drawable/edittext"
android:singleLine="true"
android:paddingLeft="4dp"
android:layout_weight="1"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/email_id"
android:id="#+id/emailIdTextView"
android:layout_gravity="left|center_vertical"
android:textColor="#android:color/white"
android:layout_marginTop="10dp"
android:layout_marginBottom="5dp"
android:paddingLeft="2dp"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:ems="10"
android:id="#+id/emailIdEditText"
android:layout_gravity="center_vertical"
android:singleLine="true"
android:layout_weight="1"
android:background="#drawable/edittext"
android:paddingLeft="4dp"
android:layout_margin="5dp" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/problem_type"
android:id="#+id/problemTypeTextView"
android:layout_gravity="left|center_vertical"
android:textColor="#android:color/white"
android:layout_marginTop="10dp"
android:layout_marginBottom="5dp"
android:paddingLeft="2dp"/>
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:text="#string/fetch_problem_types"
android:id="#+id/button"
android:background="#drawable/buttonback"
android:textColor="#android:color/white"
android:layout_gravity="center"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/location"
android:id="#+id/locationTextView"
android:layout_gravity="left|center_vertical"
android:textColor="#android:color/white"
android:layout_marginTop="10dp"
android:layout_marginBottom="5dp"
android:paddingLeft="2dp"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPostalAddress"
android:ems="10"
android:id="#+id/locationEditText"
android:layout_gravity="bottom"
android:singleLine="true"
android:background="#drawable/edittext"
android:paddingLeft="4dp"
android:layout_weight="1" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/brief_desc"
android:id="#+id/briefDescTextView"
android:layout_gravity="left|center_vertical"
android:textColor="#android:color/white"
android:layout_marginTop="10dp"
android:layout_marginBottom="5dp"
android:paddingLeft="2dp"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/briefDescEditText"
android:singleLine="true"
android:layout_gravity="bottom"
android:background="#drawable/edittext"
android:paddingLeft="4dp"
android:layout_weight="1" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/doc_desc"
android:id="#+id/docDescTextView"
android:layout_gravity="left|center_vertical"
android:textColor="#android:color/white"
android:layout_marginTop="10dp"
android:layout_marginBottom="5dp"
android:paddingLeft="2dp"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/docDescEditText"
android:layout_gravity="bottom"
android:singleLine="true"
android:background="#drawable/edittext"
android:paddingLeft="4dp"
android:layout_weight="1" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/approval_memo"
android:id="#+id/approvalMemoTextView"
android:layout_gravity="left|center_vertical"
android:layout_marginTop="10dp"
android:textColor="#android:color/white"
android:layout_marginBottom="5dp"
android:paddingLeft="2dp"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/approvalMemoEditText"
android:layout_gravity="bottom"
android:singleLine="true"
android:background="#drawable/edittext"
android:paddingLeft="4dp"
android:layout_weight="1"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/requester_Name"
android:id="#+id/requesterNameTextView"
android:layout_gravity="left|center_vertical"
android:layout_marginTop="10dp"
android:textColor="#android:color/white"
android:layout_marginBottom="5dp"
android:paddingLeft="2dp"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/requesterNameEditText"
android:layout_gravity="bottom"
android:singleLine="true"
android:background="#drawable/edittext"
android:layout_weight="1"
android:layout_marginBottom="5dp"
android:paddingLeft="4dp"
/>
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:text="#string/submit_button_title"
android:id="#+id/submitButton"
android:layout_gravity="center_vertical"
android:background="#drawable/buttonback"
android:textColor="#android:color/white"
android:layout_marginTop="10dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_marginBottom="5dp"/>
</LinearLayout>
</ScrollView>
</LinearLayout>
The problem (most probably) lies in the top level XML. I assume you posted only the content.xml which is included my activity_main.xml, because I can't see the Floating Action Button.
I guess you used the build-in generator to create layouts for you and edited the content.xml one. The paddings are defined inside the activity_main.xml one. Delete them and you are good to go.
Remove layout android:layout_margin="5dp" in Email Id EditText
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:ems="10"
android:id="#+id/emailIdEditText"
android:layout_gravity="center_vertical"
android:singleLine="true"
android:layout_weight="1"
android:background="#drawable/edittext"
android:paddingLeft="4dp" />
I have a Linear Layout but somehow, no matter what, the login button dose not sits exactly below the text fields. the button always exceeds from the elements.
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:context="${relativePackage}.${activityClass}"
>
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:contentDescription="#string/AppLogDescription"
android:src="#drawable/applogo" />
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:orientation="vertical"
android:layout_below="#+id/imageView1"
android:layout_alignParentBottom="true">
<EditText
android:id="#+id/editText_email"
android:layout_width="272dp"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:drawableLeft="#drawable/mail_icon"
android:drawableStart="#drawable/mail_icon"
android:drawablePadding="10dp"
android:padding="10dp"
android:background="#drawable/edit_text_border"
/>
<EditText
android:id="#+id/editText_Password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword"
android:drawableLeft="#drawable/password_icon"
android:drawableStart="#drawable/password_icon"
android:background="#drawable/edit_text_border"
android:gravity="center"
android:drawablePadding="5dp"
android:padding="10dp"
android:layout_marginTop="5dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:text="Name"
android:ems="10"
android:id="#+id/editText"
android:layout_weight="1" />
<Button
android:id="#+id/LogInButton"
android:layout_width="284dp"
android:layout_height="wrap_content"
android:text="#string/LogIn"
android:onClick="LogInClickEvent" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="1">
<Switch
android:id="#+id/cb_login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_margin="1dp"
android:onClick="RememberMe_click"
android:gravity="center_vertical"
android:switchMinWidth="56dp"
android:textOff=""
android:textOn=""
android:layout_marginTop="10dp"
android:checked="false" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Remember me"
android:layout_marginTop="10dp"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_weight="0.70" />
<Button
android:id="#+id/TV_LogIn"
android:background="#android:color/transparent"
android:layout_width="wrap_content"
android:layout_height="23dp"
android:text="Forget Password?"
android:textSize="10dp"
android:layout_marginTop="10dp"
android:onClick="ForgetPasswordEvent"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</LinearLayout>
</RelativeLayout >
</ScrollView>
My text fields seems straight but the buttons (login button and remember me switch) seem to be off grid and a bit more to the right then the fields
Remove your android:padding="10dp" from your second edittext
and android:layout_marginTop="10dp from your button.
And make sure your linearlayout orientation is vertical.
EDIT:
you should use layout_gravity="center" instead of android:layout_centerHorizontal="true" and android:layout_alignParentBottom="true" which are for RelativeLayout
or put your linearLayout inside a RelativeLayout which should be your root layout.
Try this:
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="vertical"
android:layout_below="#+id/imageView1"
android:layout_alignParentBottom="true">
<EditText
android:id="#+id/editText_email"
android:layout_width="255dp"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:drawableLeft="#drawable/mail_icon"
android:drawableStart="#drawable/mail_icon"
android:drawablePadding="10dp"
android:padding="10dp"
android:gravity="center"
android:background="#drawable/edit_text_border"
/>
<EditText
android:id="#+id/editText_Password"
android:layout_width="255dp"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword"
android:drawableLeft="#drawable/password_icon"
android:drawableStart="#drawable/password_icon"
android:background="#drawable/edit_text_border"
android:gravity="center"
android:drawablePadding="5dp"
android:padding="10dp"
android:layout_marginTop="5dp" />
<Button
android:id="#+id/LogInButton"
android:layout_width="261dp"
android:layout_height="wrap_content"
android:text="#string/LogIn"
android:gravity="center"
android:onClick="LogInClickEvent"
android:layout_marginTop="10dp"
/>
This will not work if you want to put everything on bottom:
android:layout_alignParentBottom="true"
Because it is for RelativeLayout and not for LinearLayout.
I have two buttons Login and Scan. I want these buttons to be in a horizontal way just like in a single row. I tied making the layout horizontal. However it does not work. They should appear side by side. My code is as follows.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/imagesand"
android:orientation="vertical"
tools:context=".MainActivity" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/imagesand"
android:gravity="center"
android:orientation="vertical" >
<LinearLayout
android:layout_width="207dp"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:background="#drawable/loginbg"
android:gravity="center"
android:orientation="vertical"
android:layout_alignParentBottom="true"
android:paddingLeft="20dp"
android:paddingRight="20dp" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="User Name"
android:textAppearance="#android:style/TextAppearance.Medium" />
<EditText
android:id="#+id/emailid"
android:layout_width="156dp"
android:layout_height="45dp"
android:layout_marginTop="5dp"
android:background="#drawable/button"
android:hint="User Name"
android:inputType="text"
android:paddingLeft="10dp"
android:textAppearance="#android:style/TextAppearance.Medium" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="Password"
android:textAppearance="#android:style/TextAppearance.Medium" />
<EditText
android:id="#+id/password"
android:layout_width="156dp"
android:layout_height="45dp"
android:layout_marginTop="5dp"
android:background="#drawable/button"
android:hint="Password"
android:inputType="textPassword"
android:paddingLeft="10dp"
android:textAppearance="#android:style/TextAppearance.Medium" />
<Button
android:id="#+id/login"
android:layout_width="71dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:background="#drawable/login"
android:text="Login"
android:textAppearance="#android:style/TextAppearance.Medium"
android:textColor="#000000"
android:typeface="serif" />
<Button android:id="#+id/scan"
and
android:layout_width="71dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:background="#drawable/login"
android:text="scan"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Just put both button in LinearLayout whose orientation must be horizontal
Simple use this..
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="#+id/textView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="left|center"
android:layout_weight="1"
android:text="Login"
android:textColor="#000000" />
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:text="Scan"
android:textColor="#000000" />
</LinearLayout>
</LinearLayout>
Use this code:
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/imagesand"
android:gravity="center"
android:orientation="vertical" >
<LinearLayout
android:layout_width="207dp"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:background="#drawable/loginbg"
android:gravity="center"
android:orientation="vertical"
android:layout_alignParentBottom="true"
android:paddingLeft="20dp"
android:paddingRight="20dp" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="User Name"
android:textAppearance="#android:style/TextAppearance.Medium" />
<EditText
android:id="#+id/emailid"
android:layout_width="156dp"
android:layout_height="45dp"
android:layout_marginTop="5dp"
android:background="#drawable/button"
android:hint="User Name"
android:inputType="text"
android:paddingLeft="10dp"
android:textAppearance="#android:style/TextAppearance.Medium" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="Password"
android:textAppearance="#android:style/TextAppearance.Medium" />
<EditText
android:id="#+id/password"
android:layout_width="156dp"
android:layout_height="45dp"
android:layout_marginTop="5dp"
android:background="#drawable/button"
android:hint="Password"
android:inputType="textPassword"
android:paddingLeft="10dp"
android:textAppearance="#android:style/TextAppearance.Medium" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
<Button
android:id="#+id/login"
android:layout_width="71dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:background="#drawable/login"
android:text="Login"
android:textAppearance="#android:style/TextAppearance.Medium"
android:textColor="#000000"
android:typeface="serif" />
<Button android:id="#+id/scan"
and
android:layout_width="71dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:background="#drawable/login"
android:text="scan"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
You can either wrap the buttons within a horizontal LinearLayout like this:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<Button
android:id="#+id/login"
android:layout_width="71dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:background="#drawable/login"
android:text="Login"
android:textAppearance="#android:style/TextAppearance.Medium"
android:textColor="#000000"
android:typeface="serif" />
<Button android:id="#+id/scan"
android:layout_width="71dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:background="#drawable/login"
android:text="scan"/>
</LinearLayout>
or use a RelativeLayout.
RealtiveLayout is the best choice:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Button
android:id="#+id/button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/entry"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="#+id/space"
/>
<TextView
android:id="#id/space"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"/>
<Button
android:id="#+id/button02"
android:layout_toRightOf="#id/button01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#id/entry"
android:layout_alignParentRight="true"
/>
</RelativeLayout>
Seems like you want two equal buttons, not wrapped content. I created a centered spacer using TextView, and relatively aligned to that. Left button to parent left and spacer, Right button to Left Button and parent right.
This should works:
Change these,
<Button
android:id="#+id/login"
android:layout_width="71dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:background="#drawable/login"
android:text="Login"
android:textAppearance="#android:style/TextAppearance.Medium"
android:textColor="#000000"
android:typeface="serif" />
<Button android:id="#+id/scan"
and
android:layout_width="71dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:background="#drawable/login"
android:text="scan"/>
with this,
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal" >
<Button
android:id="#+id/login"
android:layout_width="71dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:background="#drawable/login"
android:text="Login"
android:textAppearance="#android:style/TextAppearance.Medium"
android:textColor="#000000"
android:typeface="serif" />
<Button
android:id="#+id/scan"
android:layout_width="71dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:background="#drawable/login"
android:text="scan" />
</LinearLayout>
Suppose I have two or more EditTextview in my layout and at run time by mistake I selected 2nd view and filled it with text; now I want to go to previous EditText view and on touch gain it's focus to write some text inside it.
But I am unable to do this. I can't gain focus of view and write it on click that particular view.
See the code below:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#drawable/wall">
<EditText
android:id="#+id/title"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:textSize="30dp"
android:focusable="true"
android:hint="#string/Title" />
<EditText
android:id="#+id/body"
android:layout_width="fill_parent"
android:layout_height="350dp"
android:textSize="25dp"
android:paddingTop="45dp"
android:gravity="top"
android:inputType="textMultiLine|textNoSuggestions"
android:ems="10"
android:focusable="true"
android:hint="#string/program" />
<TextView
android:id="#+id/CalDisplay"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:textSize="20dp"
android:layout_below="#+id/save" />
<Button
android:id="#+id/Calculate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/body"
android:layout_toRightOf="#+id/RunProgram"
android:background="#drawable/custom_button"
android:textColor="#ffffff"
android:text="#string/Calculate" />
<Button
android:id="#+id/save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/Calculate"
android:layout_alignBottom="#+id/Calculate"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="#+id/RunProgram"
android:background="#drawable/custom_button"
android:textColor="#ffffff"
android:text="#string/Save"
/>
<Button
android:id="#+id/RunProgram"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/body"
android:layout_centerHorizontal="true"
android:background="#drawable/custom_button"
android:textColor="#ffffff"
android:text="#string/Run" />
</RelativeLayout>
Try this...
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<EditText
android:id="#+id/title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:hint="Title"
android:textSize="15dp" />
<EditText
android:id="#+id/body"
android:layout_width="fill_parent"
android:layout_height="350dp"
android:layout_below="#+id/title"
android:layout_marginTop="5dp"
android:gravity="left"
android:hint="program"
android:inputType="textMultiLine|textNoSuggestions"
android:textSize="15dp" />
<TextView
android:id="#+id/CalDisplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_below="#+id/save"
android:textSize="20dp" />
<LinearLayout
android:id="#+id/linearButtons"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/body" >
<Button
android:id="#+id/Calculate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Calculate"
android:textColor="#ffffff" />
<Button
android:id="#+id/save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Save"
android:textColor="#ffffff" />
<Button
android:id="#+id/RunProgram"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Run"
android:textColor="#ffffff" />
</LinearLayout>
</RelativeLayout>
Replace RelativeLayout with LinearLayout. Because it seems like your EditText are overlapping each other (causing the problem in getting focus), or at least add some respective aligning to them.
For example, add the following to your second EditText:
android:layout_below="#id/title"
I created a vertical linear layout and placed many items in it, and only part of them can be displayed on the screen. I can see the first several items of the layout but can't see the last several items of the layout.
How can I make the linear layout scrollable so the user can scroll the screen to see the last several items of the linear layout?
following is the content of the layout xml file:
<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/textView_gridw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="Grid Width"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_gridw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="number" >
<requestFocus />
</EditText>
<TextView
android:id="#+id/textView_gridh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="Height"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_gridh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="number" />
<TextView
android:id="#+id/textView_gridbt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="Border thickness"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_gridborderthickness"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="number" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView_bgw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="BgImg Width"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_bgw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:focusable="false"
android:inputType="number" />
<TextView
android:id="#+id/textView_bgh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="Height"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_bgh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:focusable="false"
android:inputType="number" />
<TextView
android:id="#+id/textView_mtgw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="MTG Width"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_mtgw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="number" />
<TextView
android:id="#+id/textView_mtgh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="Height"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_mtgh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="number" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView_margin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Margin(left, top, right, bottom):"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<EditText
android:id="#+id/editText_margin_l"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="number" />
<EditText
android:id="#+id/editText_margin_t"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="number" />
<EditText
android:id="#+id/editText_margin_r"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="number" />
<EditText
android:id="#+id/editText_margin_b"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="number" />
</LinearLayout>
<TextView
android:id="#+id/textView_pathname_bg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Background image file path name:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_pathname_bg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10" />
<TextView
android:id="#+id/textView_pathname_thumbdir"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Thumbnail images directory path name:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_pathname_thumbdir"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10" />
<TextView
android:id="#+id/textView_pathname_treasure"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Treasure image file path name:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_pathname_treasure"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10" />
<TextView
android:id="#+id/textView_pathname_signature"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Signature image file path name:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_pathname_signature"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button
android:id="#+id/button_reset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="reset"
android:text="Reset" />
<Button
android:id="#+id/button_apply"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="apply"
android:text="Apply" />
</LinearLayout>
</LinearLayout>
You should wrap your LinearLayout in a ScrollView:
Layout container for a view hierarchy that can be scrolled by the user, allowing it to be larger than the physical display. A ScrollView is a FrameLayout, meaning you should place one child in it containing the entire contents to scroll; this child may itself be a layout manager with a complex hierarchy of objects. A child that is often used is a LinearLayout in a vertical orientation, presenting a vertical array of top-level items that the user can scroll through.
You can use ScrollView, as follows:
<?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" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
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/textView_gridw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="Grid Width"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_gridw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="number" >
<requestFocus />
</EditText>
<TextView
android:id="#+id/textView_gridh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="Height"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_gridh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="number" />
<TextView
android:id="#+id/textView_gridbt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="Border thickness"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_gridborderthickness"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="number" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView_bgw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="BgImg Width"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_bgw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:focusable="false"
android:inputType="number" />
<TextView
android:id="#+id/textView_bgh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="Height"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_bgh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:focusable="false"
android:inputType="number" />
<TextView
android:id="#+id/textView_mtgw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="MTG Width"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_mtgw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="number" />
<TextView
android:id="#+id/textView_mtgh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="Height"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_mtgh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="number" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView_margin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Margin(left, top, right, bottom):"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<EditText
android:id="#+id/editText_margin_l"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="number" />
<EditText
android:id="#+id/editText_margin_t"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="number" />
<EditText
android:id="#+id/editText_margin_r"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="number" />
<EditText
android:id="#+id/editText_margin_b"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="number" />
</LinearLayout>
<TextView
android:id="#+id/textView_pathname_bg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Background image file path name:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_pathname_bg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10" />
<TextView
android:id="#+id/textView_pathname_thumbdir"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Thumbnail images directory path name:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_pathname_thumbdir"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10" />
<TextView
android:id="#+id/textView_pathname_treasure"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Treasure image file path name:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_pathname_treasure"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10" />
<TextView
android:id="#+id/textView_pathname_signature"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Signature image file path name:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText_pathname_signature"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button
android:id="#+id/button_reset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="reset"
android:text="Reset" />
<Button
android:id="#+id/button_apply"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="apply"
android:text="Apply" />
</LinearLayout>
</LinearLayout>
</ScrollView>