I have a number of data entry screens in my app. In each of them, the last EditText on the screen does not display. It is usable in that you can press in it and type text, but it should be visible also.
Here is the code for one of the screens:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.pdrestimator.Main_Activity$Car_Fragment">
<RelativeLayout
android:id="#+id/relativeLayout"
android:layout_width="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:layout_height="match_parent"
>
<TextView
android:id="#+id/vinLabel"
android:layout_alignParentTop="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="12dp"
android:textSize="20dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="VIN" />
<EditText
android:id="#+id/vin"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/carVinLabel"
android:layout_marginRight="10dp"
android:layout_marginLeft="140dp"
android:layout_alignBaseline="#+id/vinLabel"
android:ems="10" />
<TextView
android:id="#+id/yearLabel"
android:layout_below="#+id/vinLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20dp"
android:layout_alignParentLeft="true"
android:layout_marginTop="35dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="Year" />
<Spinner
android:id="#+id/year"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/yearLabel"
android:layout_alignLeft="#+id/vin"
android:layout_alignRight="#+id/vin"
android:layout_alignBaseline="#+id/yearLabel"
android:ems="10" />
<TextView
android:id="#+id/makeLabel"
android:layout_below="#+id/yearLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:textSize="20dp"
android:layout_marginTop="48dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="Make" />
<AutoCompleteTextView
android:id="#+id/make"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/yearLabel"
android:layout_alignLeft="#+id/vin"
android:layout_alignRight="#+id/vin"
android:layout_alignBaseline="#+id/makeLabel"
android:ems="10" />
<TextView
android:id="#+id/modelLabel"
android:layout_below="#+id/makeLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:textSize="20dp"
android:layout_marginTop="35dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="Model" />
<EditText
android:id="#+id/model"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/modelLabel"
android:layout_alignLeft="#+id/vin"
android:layout_alignRight="#+id/vin"
android:layout_alignBaseline="#+id/modelLabel"
android:ems="10" />
<TextView
android:id="#+id/colorLabel"
android:layout_below="#+id/modelLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="35dp"
android:textSize="20dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="Color" />
<AutoCompleteTextView
android:id="#+id/color"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/colorLabel"
android:layout_alignLeft="#+id/vin"
android:layout_alignRight="#+id/vin"
android:layout_alignBaseline="#+id/colorLabel"
android:ems="10" />
<TextView
android:id="#+id/manufactureDateLabel"
android:layout_below="#+id/colorLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:textSize="20dp"
android:layout_marginTop="35dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="Manuf. Date" />
<EditText
android:id="#+id/manufactureDate"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/manufactureDateLabel"
android:layout_alignLeft="#+id/vin"
android:layout_alignRight="#+id/vin"
android:layout_alignBaseline="#+id/manufactureDateLabel"
android:ems="10" />
<TextView
android:id="#+id/stockNumberLabel"
android:layout_below="#+id/manufactureDateLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:textSize="20dp"
android:layout_marginTop="35dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="Stock Number" />
<EditText
android:id="#+id/stockNumber"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/stockNumberLabel"
android:layout_alignLeft="#+id/vin"
android:layout_alignRight="#+id/vin"
android:layout_alignBaseline="#+id/stockNumberLabel"
android:ems="10" />
</RelativeLayout>
</ScrollView>
Any help would be greatly appreciated!
<EditText
android:id="#+id/stockNumber"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/stockNumberLabel"
android:layout_alignLeft="#+id/vin"
android:layout_alignRight="#+id/vin"
android:layout_alignBottom="#+id/stockNumberLabel"
android:ems="10" />
layout_alignBottom instead of baseline does the trick!
Worth looking at this
Use this
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.pdrestimator.Main_Activity$Car_Fragment">
<RelativeLayout
android:id="#+id/relativeLayout"
android:layout_width="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:layout_height="wrap_content"
>
<TextView
android:id="#+id/vinLabel"
android:layout_alignParentTop="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="12dp"
android:textSize="20dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="VIN" />
<EditText
android:id="#+id/vin"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/vinLabel"
android:layout_marginRight="10dp"
android:layout_marginLeft="140dp"
android:layout_alignBaseline="#+id/vinLabel"
android:ems="10" />
<TextView
android:id="#+id/yearLabel"
android:layout_below="#+id/vinLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20dp"
android:layout_alignParentLeft="true"
android:layout_marginTop="35dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="Year" />
<Spinner
android:id="#+id/year"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/yearLabel"
android:layout_alignLeft="#+id/vin"
android:layout_alignRight="#+id/vin"
android:layout_alignBaseline="#+id/yearLabel"
android:ems="10" />
<TextView
android:id="#+id/makeLabel"
android:layout_below="#+id/yearLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:textSize="20dp"
android:layout_marginTop="48dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="Make" />
<AutoCompleteTextView
android:id="#+id/make"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/yearLabel"
android:layout_alignLeft="#+id/vin"
android:layout_alignRight="#+id/vin"
android:layout_alignBaseline="#+id/makeLabel"
android:ems="10" />
<TextView
android:id="#+id/modelLabel"
android:layout_below="#+id/makeLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:textSize="20dp"
android:layout_marginTop="35dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="Model" />
<EditText
android:id="#+id/model"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/modelLabel"
android:layout_alignLeft="#+id/vin"
android:layout_alignRight="#+id/vin"
android:layout_alignBaseline="#+id/modelLabel"
android:ems="10" />
<TextView
android:id="#+id/colorLabel"
android:layout_below="#+id/modelLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="35dp"
android:textSize="20dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="Color" />
<AutoCompleteTextView
android:id="#+id/color"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/colorLabel"
android:layout_alignLeft="#+id/vin"
android:layout_alignRight="#+id/vin"
android:layout_alignBaseline="#+id/colorLabel"
android:ems="10" />
<TextView
android:id="#+id/manufactureDateLabel"
android:layout_below="#+id/colorLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:textSize="20dp"
android:layout_marginTop="35dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="Manuf. Date" />
<EditText
android:id="#+id/manufactureDate"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/manufactureDateLabel"
android:layout_alignLeft="#+id/vin"
android:layout_alignRight="#+id/vin"
android:layout_alignBaseline="#+id/manufactureDateLabel"
android:ems="10" />
<TextView
android:id="#+id/stockNumberLabel"
android:layout_below="#+id/manufactureDateLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:textSize="20dp"
android:layout_marginTop="35dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="Stock Number" />
<EditText
android:id="#+id/stockNumber"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/stockNumberLabel"
android:layout_alignLeft="#+id/vin"
android:layout_alignRight="#+id/vin"
android:layout_alignBottom="#+id/stockNumberLabel"
android:ems="10" />
</RelativeLayout>
Related
HI,
In my android app,the emulator screen is rotating in landscape i didn't get the full view of a registration form. But in portrait mode it works perfectly. Please Look through it.Thanks in Advance.
activity_main
<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:orientation="vertical"
android:padding="10dp"
android:weightSum="1">
<TextView
android:text="Soil Test Based Nutrient Recommendations"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
android:textAlignment="center"
android:id="#+id/title"
android:layout_weight="0.03" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textColor="#000000"
android:text="Crop"/>
<Spinner android:id="#+id/spinFood"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<TextView
android:text="State"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
android:id="#+id/textView" />
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/spinner" />
<TextView
android:text="Category"
android:textColor="#000000"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/textView2" />
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/spinner2" />
<TextView
android:text="Soil_Texture"
android:textColor="#000000"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/textView3" />
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/spinner3" />
<TextView
android:text="pH"
android:textColor="#000000"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/textView4" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:text=""
android:ems="10"
android:id="#+id/editText" />
<TextView
android:text="Available Phosphorus"
android:textColor="#000000"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/textView5" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:text=""
android:ems="10"
android:id="#+id/editText2" />
<TextView
android:text="Available Pottassium"
android:textColor="#000000"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/textView6" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:text=""
android:ems="10"
android:id="#+id/editText3" />
<Button
android:text="Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/button" />
</LinearLayout>
<ScrollView 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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="10dp"
android:weightSum="1">
<TextView
android:text="Soil Test Based Nutrient Recommendations"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
android:textAlignment="center"
android:id="#+id/title"
android:layout_weight="0.03" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textColor="#000000"
android:text="Crop"/>
<Spinner android:id="#+id/spinFood"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<TextView
android:text="State"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
android:id="#+id/textView" />
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/spinner" />
<TextView
android:text="Category"
android:textColor="#000000"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/textView2" />
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/spinner2" />
<TextView
android:text="Soil_Texture"
android:textColor="#000000"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/textView3" />
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/spinner3" />
<TextView
android:text="pH"
android:textColor="#000000"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/textView4" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:text=""
android:ems="10"
android:id="#+id/editText" />
<TextView
android:text="Available Phosphorus"
android:textColor="#000000"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/textView5" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:text=""
android:ems="10"
android:id="#+id/editText2" />
<TextView
android:text="Available Pottassium"
android:textColor="#000000"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/textView6" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:text=""
android:ems="10"
android:id="#+id/editText3" />
<Button
android:text="Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/button" />
</LinearLayout>
</ScrollView>
Just wrap into ScrollView to Main LinearLayout
Add android:screenOrientation="portrait" to the activity you want to disable landscape mode.
How to fix background image with scrollview when windowSoftInputMode appears.
I used windowSoftInputMode="adjustPan",but scrollview doesn't work
completely, please help me. Last fields do not appear when virtual keyboard
appears.
I want that background image should not scroll up with virtual keyboard
and scrollview should show all the fields inside it while scrolling.
Here is my code
<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/back">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/cancel_done_btn"
android:layout_marginLeft="30dp"
android:layout_marginTop="40dp"
android:textSize="17dp"
android:paddingTop="10dp"
android:textStyle="bold"
android:paddingBottom="10dp"
android:paddingLeft="28dp"
android:paddingRight="28dp"
android:text="#string/cancel"
android:id="#+id/btn_cancel_signin"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/cancel_done_btn"
android:layout_marginRight="30dp"
android:layout_marginTop="40dp"
android:textSize="17dp"
android:text="#string/done"
android:paddingTop="10dp"
android:textStyle="bold"
android:paddingBottom="10dp"
android:paddingLeft="35dp"
android:paddingRight="35dp"
android:layout_alignParentRight="true"
android:id="#+id/btn_done_signin"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="120dp"
android:layout_marginLeft="40dp"
android:orientation="vertical"
android:layout_below="#+id/btn_cancel_signin">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="times new roman"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Tuesday,May"
android:textSize="25dp"
android:textStyle="bold"
android:id="#+id/tv_day_month" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="times new roman"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text=" 7,2016"
android:textSize="25dp"
android:textStyle="bold"
android:id="#+id/tv_date" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="200dp"
android:layout_marginLeft="130dp"
android:layout_below="#+id/btn_cancel_signin">
<ImageView
android:id="#+id/iv_signin_logo"
android:layout_width="200dp"
android:layout_height="180dp"
android:src="#drawable/sign_in_logo"
android:layout_marginTop="10dp" />
</LinearLayout>
<ScrollView
android:layout_width="350dp"
android:layout_height="wrap_content"
android:id="#+id/scroller_sign_in"
android:layout_below="#+id/btn_done_signin"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true">
<LinearLayout
android:orientation="vertical"
android:paddingLeft="10dp"
android:layout_marginRight="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="30dp">
<TextView
android:layout_height="wrap_content"
android:text="First Name"
style="#style/sign_in_text"
android:id="#+id/label_firstname"
android:layout_alignParentLeft="true"
android:paddingTop="10dp"
android:inputType="textCapWords"
/>
<AutoCompleteTextView
android:id="#+id/et_firstname"
android:hint="Required"
android:ems="10"
android:textSize="20dp"
android:padding="10dp"
android:layout_width="160dp"
android:background="#drawable/et_border"
android:layout_height="wrap_content"
android:inputType="textCapWords"
android:layout_alignParentRight="true"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="20dp"
>
<TextView
android:layout_height="wrap_content"
android:text="Last Name"
android:layout_width="wrap_content"
android:paddingRight="10dp"
android:gravity="left"
android:id="#+id/label_lastname"
android:paddingTop="10dp"
android:layout_alignParentLeft="true"
android:inputType="textCapWords"
/>
<AutoCompleteTextView
android:id="#+id/et_lastname"
android:hint="Required"
android:ems="10"
android:textSize="20dp"
android:textAllCaps="true"
android:padding="10dp"
android:layout_width="160dp"
android:background="#drawable/et_border"
android:layout_alignParentRight="true"
android:layout_height="wrap_content"
android:inputType="textCapWords"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="20dp"
android:id="#+id/ll_company"
>
<TextView
android:layout_height="wrap_content"
android:text="Company"
android:layout_width="wrap_content"
android:paddingRight="10dp"
android:gravity="left"
android:layout_marginTop="10dp"
android:id="#+id/label_company"
android:layout_alignParentLeft="true"
/>
<AutoCompleteTextView
android:id="#+id/et_company"
android:ems="10"
android:textSize="20dp"
android:padding="10dp"
android:textAllCaps="true"
android:layout_width="160dp"
android:background="#drawable/et_border"
android:layout_height="wrap_content"
android:inputType="textCapWords"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<!--android:background="#drawable/contact_edittext_bg"-->
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="20dp"
android:id="#+id/ll_address"
>
<TextView
android:layout_height="wrap_content"
android:text="Address"
android:layout_width="wrap_content"
android:paddingRight="10dp"
android:gravity="left"
android:id="#+id/label_address"
android:paddingTop="15dp"
/>
<AutoCompleteTextView
android:id="#+id/et_address"
android:ems="10"
android:textSize="20dp"
android:padding="10dp"
android:layout_width="160dp"
android:background="#drawable/et_border"
android:layout_height="wrap_content"
android:inputType="textCapWords"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="20dp"
android:id="#+id/ll_city"
>
<TextView
android:layout_width="wrap_content"
android:paddingRight="10dp"
android:gravity="left"
android:layout_height="wrap_content"
android:text="City"
android:id="#+id/label_city"
android:paddingTop="15dp"
/>
<AutoCompleteTextView
android:id="#+id/et_city"
android:ems="10"
android:textSize="20dp"
android:padding="10dp"
android:layout_width="160dp"
android:background="#drawable/et_border"
android:layout_alignParentRight="true"
android:layout_height="wrap_content"
android:inputType="textCapWords"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="20dp"
android:id="#+id/ll_state"
>
<AutoCompleteTextView
android:id="#+id/et_state"
android:ems="10"
android:textSize="20dp"
android:padding="10dp"
android:layout_width="160dp"
android:background="#drawable/et_border"
android:layout_alignParentRight="true"
android:layout_height="wrap_content"
android:inputType="textCapWords"/>
<TextView
android:layout_height="wrap_content"
android:text="State"
style="#style/sign_in_text"
android:id="#+id/label_state"
android:paddingTop="15dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="20dp"
android:id="#+id/ll_zip_code"
>
<TextView
android:layout_height="wrap_content"
android:text="Zip Code"
android:layout_width="wrap_content"
android:paddingRight="10dp"
android:gravity="left"
android:id="#+id/label_zip_code"
android:paddingTop="15dp"
/>
<AutoCompleteTextView
android:id="#+id/et_zipcode"
android:ems="10"
android:layout_width="160dp"
android:background="#drawable/et_border"
android:textSize="20dp"
android:padding="10dp"
android:layout_height="wrap_content"
android:inputType="number"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
</RelativeLayout>
remove this from xml.
android:background="#drawable/back"
Write in your java file.
getWindow().setBackgroundDrawableResource(R.drawable.back);
I just put a linear layout inside a scrollview dont know why its not working.
When the keyboard is open the scrollbar is not showing at all. When i move one text box to another there is a submit button which is not show when i run on small size devices.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/white"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/white"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/layoutPopUp"
android:layout_width="match_parent"
android:layout_height="79dp"
android:background="#F57F20"
android:paddingBottom="20dp"
android:paddingTop="20dp"
android:visibility="visible">
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1">
<LinearLayout
android:id="#+id/backlayout"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:orientation="horizontal">
<ImageButton
android:id="#+id/btnBackbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:background="#color/transparent"
android:gravity="center"
android:src="#drawable/back"
android:visibility="visible" />
<TextView
android:id="#+id/textBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:gravity="center"
android:text="Back"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="15sp" />
</LinearLayout>
<TextView
android:id="#+id/textTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0.6"
android:gravity="center"
android:text="Contact Us"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="20sp"
android:textStyle="bold" />
<ImageButton
android:id="#+id/imagePopUp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="0.2"
android:background="#color/transparent"
android:gravity="center"
android:src="#drawable/menu"
android:visibility="visible" />
</LinearLayout>
</RelativeLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
android:id="#+id/editTextName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="#drawable/editboxshap"
android:ems="10"
android:hint="Name"
android:inputType="textPersonName"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#2b2b2b"
android:textColorHint="#2b2b2b"
android:textCursorDrawable="#color/black">
<requestFocus />
</EditText>
<EditText
android:id="#+id/editPhone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="#drawable/editboxshap"
android:ems="10"
android:hint="Phone No."
android:inputType="phone"
android:maxLength="12"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#2b2b2b"
android:textColorHint="#2b2b2b"
android:textCursorDrawable="#color/black" />
<EditText
android:id="#+id/editEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="#drawable/editboxshap"
android:ems="10"
android:hint="E-mail"
android:inputType="textEmailAddress"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#2b2b2b"
android:textColorHint="#2b2b2b"
android:textCursorDrawable="#color/black" />
<EditText
android:id="#+id/editComment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="#drawable/editboxshap"
android:ems="10"
android:gravity="start"
android:hint="Comments"
android:inputType="textMultiLine"
android:lines="3"
android:maxLength="500"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#2b2b2b"
android:textColorHint="#2b2b2b"
android:textCursorDrawable="#color/black" />
<Button
android:id="#+id/btnSubmit"
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="20dp"
android:background="#drawable/button_shape"
android:text="SUBMIT"
android:textColor="#color/white" />
</LinearLayout>
</ScrollView>
</LinearLayout>
try to put scrollview inside another linear layout and try
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/parentLin"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="//define in dp"
android:scrollbars="vertical"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
android:id="#+id/editTextName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="#drawable/editboxshap"
android:textColorHint="#2b2b2b"
android:textColor="#2b2b2b"
android:ems="10"
android:hint="Name"
android:inputType="textPersonName"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium">
<requestFocus />
</EditText>
<EditText
android:id="#+id/editPhone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="#drawable/editboxshap"
android:ems="10"
android:textColor="#2b2b2b"
android:hint="Phone No."
android:inputType="phone"
android:textColorHint="#2b2b2b"
android:maxLength="12"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="#drawable/editboxshap"
android:textColor="#2b2b2b"
android:ems="10"
android:textColorHint="#2b2b2b"
android:hint="E-mail"
android:inputType="textEmailAddress"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editComment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="#drawable/editboxshap"
android:ems="10"
android:gravity="start"
android:textColor="#2b2b2b"
android:hint="Comments"
android:textColorHint="#2b2b2b"
android:inputType="textMultiLine"
android:lines="3"
android:maxLength="500"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</ScrollView>
<RelativeLayout
android:id="#+id/footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center">
<Button
android:id="#+id/btnSubmit"
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="5dp"
android:layout_marginTop="20dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#drawable/button_shape"
android:text="SUBMIT"
android:textColor="#color/white" />
</RelativeLayout>
</RelativeLayout>
and You have to specify the following line of code in the manifest file with your activity
android:windowSoftInputMode="adjustResize"
try This.. on your activity / fragment
getActivity().getWindow()
.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE |
WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
I'm trying to make a form that has many textView and editText controls so I tried using scrollview because the screen won't be able to display all of them.
But when I added to a certain set of textview and scrollview, the next one appears on the top side of the screen instead of below the previous set.
Below is my xml, Please help!
XML FILE :
<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:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".InsertJob" >
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="358dp"
android:orientation="vertical" >
<TextView
android:id="#+id/JobNameTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:text="#string/name" />
<EditText
android:id="#+id/JobNameET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/JobNameTV"
android:layout_alignBottom="#+id/JobNameTV"
android:layout_marginLeft="70dp"
android:layout_marginRight="20dp"
android:layout_toRightOf="#+id/JobNameTV"
android:ems="10"
android:inputType="textPersonName" />
<TextView
android:id="#+id/JobDateTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/JobNameTV"
android:layout_below="#+id/JobNameET"
android:layout_marginTop="25dp"
android:text="#string/date" />
<EditText
android:id="#+id/JobDateET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/JobDateTV"
android:layout_alignBottom="#+id/JobDateTV"
android:layout_alignLeft="#+id/JobNameET"
android:layout_marginRight="20dp"
android:ems="10"
android:hint="#string/date_example"
android:inputType="date" >
<requestFocus />
</EditText>
<TextView
android:id="#+id/JobTimeStartTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/JobDateTV"
android:layout_below="#+id/JobDateTV"
android:layout_marginTop="25dp"
android:text="Jam Mulai" />
<EditText
android:id="#+id/JobTimeStartET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/JobTimeStartTV"
android:layout_alignBottom="#+id/JobTimeStartTV"
android:layout_alignLeft="#+id/JobDateET"
android:layout_marginRight="20dp"
android:ems="10"
android:hint="#string/timeexample"
android:inputType="time" />
<TextView
android:id="#+id/JobTimeEndTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/JobDateTV"
android:layout_below="#+id/JobTimeStartTV"
android:layout_marginTop="25dp"
android:text="Jam Selesai" />
<EditText
android:id="#+id/JobTimeEndET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/JobTimeEndTV"
android:layout_alignBottom="#+id/JobTimeEndTV"
android:layout_alignLeft="#+id/JobDateET"
android:layout_marginRight="20dp"
android:ems="10"
android:hint="#string/timeexample"
android:inputType="time" />
<TextView
android:id="#+id/JobPlaceTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/JobTimeEndTV"
android:layout_below="#+id/JobTimeEndET"
android:layout_marginTop="25dp"
android:text="#string/place" />
<EditText
android:id="#+id/JobPlaceET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/JobPlaceTV"
android:layout_alignBottom="#+id/JobPlaceTV"
android:layout_alignLeft="#+id/JobTimeEndET"
android:layout_marginRight="20dp"
android:ems="10"
android:inputType="text" />
<TextView
android:id="#+id/JobDetailTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/JobPlaceTV"
android:layout_below="#+id/JobPlaceET"
android:layout_marginTop="40dp"
android:text="Detail" />
<EditText
android:id="#+id/JobDetailET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/JobPlaceET"
android:layout_alignBaseline="#+id/JobDetailTV"
android:layout_marginRight="20dp"
android:ems="10"
android:inputType="textMultiLine" />
<TextView
android:id="#+id/SongListTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/JobDetailTV"
android:layout_below="#+id/JobDetailET"
android:layout_marginTop="20dp"
android:text="Lagu 1" />
<EditText
android:id="#+id/SongListET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/JobDetailET"
android:layout_alignBaseline="#+id/SongListTV"
android:ems="10"
android:inputType="text" />
</RelativeLayout>
</ScrollView>
<Button
android:id="#+id/LogoutBtn"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="20dp"
android:layout_marginRight="20dp"
android:background="#drawable/logout"
android:onClick="logout" />
<Button
android:id="#+id/ConfirmBtn"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignBottom="#+id/LogoutBtn"
android:layout_marginLeft="20dp"
android:background="#drawable/confirm" />
</RelativeLayout>
// Try this way,hope this will help you to solve your problem.
<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:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".InsertJob" >
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="358dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="20dp">
<TextView
android:id="#+id/JobNameTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="#string/name" />
<EditText
android:id="#+id/JobNameET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#id/JobNameTV"
android:layout_marginLeft="70dp"
android:layout_toRightOf="#id/JobNameTV"
android:ems="10"
android:inputType="textPersonName" />
<TextView
android:id="#+id/JobDateTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/JobNameET"
android:layout_marginTop="25dp"
android:text="#string/date" />
<EditText
android:id="#+id/JobDateET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/JobNameET"
android:layout_alignBaseline="#id/JobDateTV"
android:layout_toRightOf="#id/JobDateTV"
android:ems="10"
android:hint="#string/date_example"
android:inputType="date" >
</EditText>
<TextView
android:id="#+id/JobTimeStartTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/JobDateTV"
android:layout_marginTop="25dp"
android:text="Jam Mulai" />
<EditText
android:id="#+id/JobTimeStartET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/JobDateET"
android:layout_alignBaseline="#id/JobTimeStartTV"
android:layout_toRightOf="#id/JobTimeStartTV"
android:ems="10"
android:hint="#string/timeexample"
android:inputType="time" />
<TextView
android:id="#+id/JobTimeEndTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/JobTimeStartTV"
android:layout_marginTop="25dp"
android:text="Jam Selesai" />
<EditText
android:id="#+id/JobTimeEndET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/JobTimeStartET"
android:layout_alignBaseline="#id/JobTimeEndTV"
android:layout_toRightOf="#id/JobTimeEndTV"
android:ems="10"
android:hint="#string/timeexample"
android:inputType="time" />
<TextView
android:id="#+id/JobPlaceTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/JobTimeEndTV"
android:layout_marginTop="25dp"
android:text="#string/place" />
<EditText
android:id="#+id/JobPlaceET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/JobTimeEndET"
android:layout_alignBaseline="#id/JobPlaceTV"
android:layout_toRightOf="#id/JobPlaceTV"
android:ems="10"
android:inputType="text" />
<TextView
android:id="#+id/JobDetailTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/JobPlaceTV"
android:layout_marginTop="40dp"
android:text="Detail" />
<EditText
android:id="#+id/JobDetailET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/JobPlaceET"
android:layout_alignBaseline="#id/JobDetailTV"
android:layout_toRightOf="#id/JobDetailTV"
android:ems="10"
android:inputType="textMultiLine" />
<TextView
android:id="#+id/SongListTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/JobDetailTV"
android:layout_marginTop="20dp"
android:text="Lagu 1" />
<EditText
android:id="#+id/SongListET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/JobDetailET"
android:layout_alignBaseline="#id/SongListTV"
android:layout_toRightOf="#id/SongListTV"
android:ems="10"
android:inputType="text" />
</RelativeLayout>
</ScrollView>
<Button
android:id="#+id/LogoutBtn"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="20dp"
android:layout_marginRight="20dp"
android:background="#drawable/logout"
android:onClick="logout" />
<Button
android:id="#+id/ConfirmBtn"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignBottom="#+id/LogoutBtn"
android:layout_marginLeft="20dp"
android:background="#drawable/confirm" />
</RelativeLayout>
EditText JobDateET is missing attribute "android:layout_layout_below="#+id/JobDateTV"
EditText JobTimeStartET is missing attribute "android:layout_layout_below="#+id/JobTimeStartTV"
EditText JobTimeStartET is missing attribute "android:layout_layout_below="#+id/JobTimeStartTV"
Try this.......
<TextView
android:id="#+id/SongListTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/JobDetailTV"
android:layout_marginTop="20dp"
android:text="Lagu 1"/>
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>