I have a problem with height of linear layout. When I use only linear layout, my form is scaled to screen size, and everything look like good. But now, I need to have scrollview only when I click an edittext and keyboard appear. I set scrollview as a root of my layout, but it extended height of this layout. Scrollview should be work only while keyboard appear, but now it work's every time and ruined my linearlayout. So right now, when I'm using a scrollview, layout is bigger than screen size. What should I do?
<ScrollView
android:layout_width="match_parent"
android:id="#+id/scrollView"
android:fillViewport="true"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" android:layout_height="match_parent"
tools:context=".activities.FormDialog"
>
<LinearLayout android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
android:layout_alignParentTop="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" android:background="#drawable/new_background">
<ImageView
android:layout_width="84dp"
android:id="#+id/imageView"
android:src="#drawable/applogo"
android:layout_alignParentTop="true" android:layout_centerHorizontal="true"
android:layout_marginTop="16dp"
android:layout_gravity="end" android:layout_marginRight="20dp"
android:layout_height="29dp"/>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true" android:layout_alignParentStart="true"
>
<TextView
android:text="Info"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="#+id/missedCall"
android:layout_alignParentTop="true" android:layout_centerHorizontal="true"
android:textColor="#color/apptheme_color"
android:layout_marginBottom="16dp" android:textSize="15sp" android:layout_marginTop="16dp"/>
</RelativeLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_weight="2" android:layout_height="wrap_content" android:layout_width="match_parent"
android:layout_marginLeft="25dp" android:layout_marginRight="25dp"
android:layout_marginBottom="6dp" android:weightSum="1">
<ImageView
android:text="Button"
android:id="#+id/leftButton"
android:layout_width="40dp" android:layout_height="40dp"
android:layout_gravity="center_vertical" android:src="#drawable/left"/>
<TextView
android:text="Text"
android:layout_width="244dp"
android:layout_height="match_parent" android:id="#+id/numberTextView"
android:gravity="center_vertical|center_horizontal|center"
android:textColor="#color/apptheme_color" android:textSize="24sp"
android:layout_weight="1"/>
<ImageView
android:text="Button"
android:id="#+id/rightButton"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_width="40dp" android:layout_height="40dp"
android:src="#drawable/right_arrow"/>
</LinearLayout>
<TextView
android:text="Text"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="#+id/textView7"
android:textColor="#color/apptheme_color" android:textAlignment="viewStart"
android:textSize="18sp"
android:layout_weight="0.5"
android:layout_below="#+id/missedCall" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" android:layout_marginLeft="30dp"
android:layout_marginRight="25dp"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:ems="10"
android:id="#+id/nameTextView"
android:background="#drawable/blueborder"
android:textColorHint="#FFFFFF"
android:textColor="#FFFFFF"
android:layout_marginLeft="25dp" android:layout_marginRight="25dp" android:layout_marginTop="16dp"
android:paddingTop="10dp" android:paddingBottom="10dp"
android:hint="Edit1" android:paddingLeft="10dp"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:ems="10"
android:id="#+id/detailsTextView"
android:background="#drawable/blueborder"
android:textColorHint="#FFFFFF"
android:textColor="#FFFFFF"
android:layout_marginLeft="25dp" android:layout_marginRight="25dp" android:layout_marginTop="6dp"
android:paddingTop="10dp" android:paddingBottom="10dp" android:paddingLeft="10dp"
android:layout_weight="1"
android:hint="Edit2"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textWebEmailAddress"
android:ems="10"
android:id="#+id/emailEditText"
android:textColorHint="#FFFFFF"
android:textColor="#FFFFFF"
android:layout_marginLeft="25dp" android:layout_marginRight="25dp" android:layout_marginTop="6dp"
android:paddingTop="10dp" android:paddingBottom="10dp" android:paddingLeft="10dp"
android:layout_weight="1"
android:hint="Edit3"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:ems="10"
android:id="#+id/companyEditText"
android:background="#drawable/blueborder"
android:textColorHint="#FFFFFF"
android:textColor="#FFFFFF"
android:layout_marginLeft="25dp" android:layout_marginRight="25dp" android:layout_marginTop="6dp"
android:paddingTop="10dp" android:paddingBottom="10dp" android:paddingLeft="10dp"
android:layout_weight="1"
android:hint="Edit4"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textMultiLine|textPersonName"
android:ems="10"
android:id="#+id/noteEditText"
android:background="#drawable/blueborder"
android:textColorHint="#FFFFFF"
android:layout_marginLeft="25dp" android:layout_marginRight="25dp" android:layout_marginTop="6dp"
android:paddingTop="10dp" android:paddingBottom="20dp" android:paddingLeft="10dp"
android:layout_weight="3.33"
android:scrollbars="vertical" android:hint="Edit5" android:lines="2" android:textColor="#FFFFFF"
android:gravity="top|center_vertical"/>
<CheckBox
android:text="Check1"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="#+id/newContactCheckbox"
android:layout_marginLeft="20dp"
android:textColor="#color/apptheme_color"
android:layout_weight="1"
/>
<CheckBox
android:text="Check2"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="#+id/isWantedCheckbox" android:layout_marginLeft="20dp"
android:textColor="#color/apptheme_color"
android:layout_weight="1"
/>
<Button
android:text="Send"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="#+id/addButton" android:layout_weight="2"
android:textColor="#02485a" android:background="#drawable/blackborder"
android:layout_marginLeft="25dp" android:layout_marginRight="25dp"
android:layout_marginBottom="16dp"/>
<TextView
android:text="Cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="#+id/notRegisterTextView"
android:textSize="14sp" android:textColor="#color/apptheme_color"
android:layout_marginLeft="25dp" android:padding="7dp"
/>
</LinearLayout>
</ScrollView>
And in Manifest I set android:windowSoftInputMode="stateUnchanged|adjustResize"
Related
I am making a Speed Dial App, which has Emergency Numbers hard-coded in it. Using nested Relative Layout and made a list of numbers.
Below is the Emergency Numbers Page.
This is a Page of Dialer App, where it has a dialer and this is the Speed Dial Section Fragment which is not scrollable.
Below is my XML fragment for the above image.
<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:padding="10dp"
android:orientation="vertical">
<!-- Relative Layouts Emergency Numbers Here - Logic - Increment Nums by 1-->
<RelativeLayout
android:background="#drawable/border"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="0dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:id="#+id/relativeLayout2">
<RelativeLayout
android:id="#+id/relativeLayout"
android:layout_width="match_parent"
android:paddingBottom="10dp"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true" />
<TextView
android:id="#+id/txtNama"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/imageView1"
android:layout_marginTop="12px"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="Emergency Number 1"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Call"
android:background="#drawable/btn_flat_blue_rounded_shadow"
android:textColor="#fff"
android:padding="10dp"
android:id="#+id/btnPolisi"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:background="#drawable/border"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="0dp"
android:id="#+id/relativeLayout3"
android:layout_marginTop="8dp"
android:layout_below="#+id/relativeLayout2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<RelativeLayout
android:id="#+id/relativeLayout4"
android:layout_width="match_parent"
android:paddingBottom="10dp"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true" />
<TextView
android:id="#+id/txtNama1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/imageView2"
android:layout_marginTop="12px"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="Emergency Number 2"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Call"
android:background="#drawable/btn_flat_blue_rounded_shadow"
android:textColor="#fff"
android:padding="10dp"
android:id="#+id/btnRS"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:background="#drawable/border"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="0dp"
android:id="#+id/relativeLayout5"
android:layout_marginTop="8dp"
android:layout_below="#+id/relativeLayout3"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<RelativeLayout
android:id="#+id/relativeLayout6"
android:layout_width="match_parent"
android:paddingBottom="10dp"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true" />
<TextView
android:id="#+id/txtNama2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/imageView3"
android:layout_marginTop="12px"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="Emergency Number 3"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Call"
android:background="#drawable/btn_flat_blue_rounded_shadow"
android:textColor="#fff"
android:padding="10dp"
android:id="#+id/btnFire"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:background="#drawable/border"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="0dp"
android:id="#+id/relativeLayout7"
android:layout_marginTop="8dp"
android:layout_below="#+id/relativeLayout5"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<RelativeLayout
android:id="#+id/relativeLayout8"
android:layout_width="match_parent"
android:paddingBottom="10dp"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true" />
<TextView
android:id="#+id/txtNama3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/imageView4"
android:layout_marginTop="12px"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="Emergency Number 4"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Call"
android:background="#drawable/btn_flat_blue_rounded_shadow"
android:textColor="#fff"
android:padding="10dp"
android:id="#+id/btnEmg4"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:background="#drawable/border"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="0dp"
android:id="#+id/relativeLayout9"
android:layout_marginTop="8dp"
android:layout_below="#+id/relativeLayout7"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<RelativeLayout
android:id="#+id/relativeLayout10"
android:layout_width="match_parent"
android:paddingBottom="10dp"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true" />
<TextView
android:id="#+id/txtNama4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/imageView5"
android:layout_marginTop="12px"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="Emergency Number 5"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Call"
android:background="#drawable/btn_flat_blue_rounded_shadow"
android:textColor="#fff"
android:padding="10dp"
android:id="#+id/btnEmg5"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:background="#drawable/border"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="0dp"
android:id="#+id/relativeLayout11"
android:layout_marginTop="8dp"
android:layout_below="#+id/relativeLayout9"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<RelativeLayout
android:id="#+id/relativeLayout12"
android:layout_width="match_parent"
android:paddingBottom="10dp"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true" />
<TextView
android:id="#+id/txtNama5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/imageView6"
android:layout_marginTop="12px"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="Emergency Number 6"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Call"
android:background="#drawable/btn_flat_blue_rounded_shadow"
android:textColor="#fff"
android:padding="10dp"
android:id="#+id/btnEmg6"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:background="#drawable/border"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="0dp"
android:id="#+id/relativeLayout13"
android:layout_marginTop="8dp"
android:layout_below="#+id/relativeLayout11"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<RelativeLayout
android:id="#+id/relativeLayout14"
android:layout_width="match_parent"
android:paddingBottom="10dp"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true" />
<TextView
android:id="#+id/txtNama6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/imageView7"
android:layout_marginTop="12px"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="Emergency Number 7"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Call"
android:background="#drawable/btn_flat_blue_rounded_shadow"
android:textColor="#fff"
android:padding="10dp"
android:id="#+id/btnEmg7"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
I have tried with the ListView inside the nested relative layout. And even the scrollview for the same, some were fatal when used. I may be using some absurd logic in this code, but the view is great for me, I just need this code to make the layout scrollable. Kindly let me know where I need to change in my code to make the page scrollable.//
When I posted this question few logical issues were there in my layouts, now I have framed it logically and it;s inside a Linear Layout.
It isnt working anyway.
<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="wrap_content"
android:padding="10dp"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
// Write here your whole code without writing first Relative Layout....
</RelativeLayout>
</ScrollView>
<RelativeLayout>
You need to put your layout inside a Scroll View. But a scroll view can have only ONE direct child. So what you need to do is take you top most relative layout and put that inside a scroll view. Something like this:
<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">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:orientation="vertical">
<RelativeLayout
android:background="#drawable/border"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="0dp"
android:layout_marginTop="10dp"
android:layout_below="#+id/relativeLayout4"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:id="#+id/relativeLayout7">
<RelativeLayout
android:id="#+id/relativeLayout3"
android:layout_width="match_parent"
android:paddingBottom="10dp"
android:layout_height="wrap_content"
android:layout_below="#+id/textView5" >
<TextView
android:id="#+id/textView5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#drawable/btn_flat_white"
android:gravity="center"
android:padding="5dp"
android:text="NEW"
android:textColor="#fff"
android:textStyle="bold"
android:visibility="gone" />
<ImageView
android:id="#+id/imageView3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true" />
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/imageView3"
android:layout_marginTop="12px"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="Emergency Number 3"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Call"
android:id="#+id/btnFire"
android:background="#drawable/btn_flat_blue_rounded_shadow"
android:textColor="#fff"
android:padding="10dp"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:background="#drawable/border"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="0dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:id="#+id/relativeLayout2">
<TextView
android:id="#+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#drawable/btn_flat_white"
android:gravity="center"
android:padding="5dp"
android:text="NEW"
android:textColor="#fff"
android:textStyle="bold"
android:visibility="gone" />
<RelativeLayout
android:id="#+id/relativeLayout"
android:layout_width="match_parent"
android:paddingBottom="10dp"
android:layout_height="wrap_content"
android:layout_below="#+id/textView" >
<ImageView
android:id="#+id/imageView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true" />
<TextView
android:id="#+id/txtNama"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/imageView2"
android:layout_marginTop="12px"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="Emergency Number 1"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Call"
android:background="#drawable/btn_flat_blue_rounded_shadow"
android:textColor="#fff"
android:padding="10dp"
android:id="#+id/btnPolisi"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:background="#drawable/border"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="0dp"
android:layout_marginTop="10dp"
android:layout_below="#+id/relativeLayout2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:id="#+id/relativeLayout4">
<TextView
android:id="#+id/tvnew"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#drawable/btn_flat_white"
android:gravity="center"
android:padding="5dp"
android:text="NEW"
android:textColor="#fff"
android:textStyle="bold"
android:visibility="gone" />
<RelativeLayout
android:id="#+id/relativeLayout1"
android:layout_width="match_parent"
android:paddingBottom="10dp"
android:layout_height="wrap_content"
android:layout_below="#+id/tvnew" >
<ImageView
android:id="#+id/ivscreenshot"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true" />
<TextView
android:id="#+id/tvwords"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/ivscreenshot"
android:layout_marginTop="12px"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="Emergency Number 2"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Call"
android:id="#+id/btnRS"
android:background="#drawable/btn_flat_blue_rounded_shadow"
android:textColor="#fff"
android:padding="10dp"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:background="#drawable/border"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="0dp"
android:id="#+id/relativeLayout5"
android:layout_marginTop="12dp"
android:layout_below="#+id/relativeLayout7"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<TextView
android:id="#+id/tvnew1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#drawable/btn_flat_white"
android:gravity="center"
android:padding="5dp"
android:text="NEW"
android:textColor="#fff"
android:textStyle="bold"
android:visibility="gone" />
<RelativeLayout
android:id="#+id/relativeLayout6"
android:layout_width="match_parent"
android:paddingBottom="10dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignLeft="#+id/tvnew1"
android:layout_alignStart="#+id/tvnew1">
<ImageView
android:id="#+id/ivscreenshot1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true" />
<TextView
android:id="#+id/tvwords1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/ivscreenshot1"
android:layout_marginTop="12px"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="Emergency Number 4"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Call"
android:id="#+id/btnEmg4"
android:background="#drawable/btn_flat_blue_rounded_shadow"
android:textColor="#fff"
android:padding="10dp"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:background="#drawable/border"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="0dp"
android:id="#+id/relativeLayout8"
android:layout_marginTop="16dp"
android:layout_below="#+id/relativeLayout5"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<TextView
android:id="#+id/tvnew2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#drawable/btn_flat_white"
android:gravity="center"
android:padding="5dp"
android:text="NEW"
android:textColor="#fff"
android:textStyle="bold"
android:visibility="gone" />
<RelativeLayout
android:id="#+id/relativeLayout10"
android:layout_width="match_parent"
android:paddingBottom="10dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignLeft="#+id/tvnew2"
android:layout_alignStart="#+id/tvnew2">
<ImageView
android:id="#+id/ivscreenshot2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true" />
<TextView
android:id="#+id/tvwords2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/ivscreenshot1"
android:layout_marginTop="12px"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="Emergency Number 5"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Call"
android:id="#+id/btnEmg5"
android:background="#drawable/btn_flat_blue_rounded_shadow"
android:textColor="#fff"
android:padding="10dp"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:background="#drawable/border"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="0dp"
android:id="#+id/relativeLayout11"
android:layout_marginTop="14dp"
android:layout_below="#+id/relativeLayout8"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<TextView
android:id="#+id/tvnew3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#drawable/btn_flat_white"
android:gravity="center"
android:padding="5dp"
android:text="NEW"
android:textColor="#fff"
android:textStyle="bold"
android:visibility="gone" />
<RelativeLayout
android:id="#+id/relativeLayout12"
android:layout_width="match_parent"
android:paddingBottom="10dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignLeft="#+id/tvnew3"
android:layout_alignStart="#+id/tvnew3">
<ImageView
android:id="#+id/ivscreenshot3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true" />
<TextView
android:id="#+id/tvwords3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/ivscreenshot3"
android:layout_marginTop="12px"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="Emergency Number 6"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Call"
android:id="#+id/btnEmg6"
android:background="#drawable/btn_flat_blue_rounded_shadow"
android:textColor="#fff"
android:padding="10dp"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:background="#drawable/border"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="0dp"
android:id="#+id/relativeLayout13"
android:layout_marginTop="7dp"
android:layout_below="#+id/relativeLayout11"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<TextView
android:id="#+id/tvnew4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#drawable/btn_flat_white"
android:gravity="center"
android:padding="5dp"
android:text="NEW"
android:textColor="#fff"
android:textStyle="bold"
android:visibility="gone" />
<RelativeLayout
android:id="#+id/relativeLayout14"
android:layout_width="match_parent"
android:paddingBottom="10dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignLeft="#+id/tvnew4"
android:layout_alignStart="#+id/tvnew4">
<ImageView
android:id="#+id/ivscreenshot4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true" />
<TextView
android:id="#+id/tvwords4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/ivscreenshot4"
android:layout_marginTop="12px"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="Emergency Number 7"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Call"
android:id="#+id/btnEmg7"
android:background="#drawable/btn_flat_blue_rounded_shadow"
android:textColor="#fff"
android:padding="10dp"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</ScrollView>
If you want to do with code:
ScrollView scrollview = new ScrollView(this);
scrollview.addView(wView);
I'm looking for an answer what should I do to prepare static layout ( without ScrollView, because when I put as a root ScrollView, then my LinearLayout is bigger than screen size, without scrollview, linearlayout is perfect ), so I have a form with 5 edittexts, and when I click on once of them, keyboard appear and now I need scroll on this form. I tried use ScrollView, android:windowSoftInputMode="adjustPan" and much more, but nothing works.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" android:background="#aa000000">
<ScrollView
android:layout_width="match_parent"
android:fillViewport="true"
android:layout_height="match_parent">
<RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content">
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="#drawable/background"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignWithParentIfMissing="false" android:scaleType="centerCrop"
android:id="#+id/blueBackground"
android:background="#aa000000"
/>
<LinearLayout android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
android:layout_alignParentTop="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<ImageView
android:layout_width="match_parent"
android:id="#+id/imageView"
android:src="#drawable/applogo"
android:layout_alignParentTop="true" android:layout_centerHorizontal="true"
android:layout_height="60dp" android:layout_marginTop="25dp"
android:layout_weight="2"
/>
<TextView
android:text="Text1"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="#+id/textView7"
android:textColor="#color/apptheme_color" android:textAlignment="viewStart"
android:gravity="center_horizontal" android:layout_marginTop="35dp" android:textSize="18sp"
android:layout_weight="1"
/>
<TextView
android:text="Text2"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="#+id/numberTextView" android:gravity="center_horizontal"
android:textColor="#color/apptheme_color" android:textSize="24sp"
android:layout_weight="1"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:ems="10"
android:id="#+id/edit1"
android:background="#drawable/blueborder"
android:textColorHint="#FFFFFF"
android:textColor="#FFFFFF"
android:layout_marginLeft="25dp" android:layout_marginRight="25dp" android:layout_marginTop="16dp"
android:paddingTop="10dp" android:paddingBottom="10dp" android:paddingLeft="10dp"
android:layout_weight="1"
android:hint="Edit1"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:ems="10"
android:id="#+id/edit2"
android:background="#drawable/blueborder"
android:textColorHint="#FFFFFF"
android:textColor="#FFFFFF"
android:layout_marginLeft="25dp" android:layout_marginRight="25dp" android:layout_marginTop="6dp"
android:paddingTop="10dp" android:paddingBottom="10dp" android:paddingLeft="10dp"
android:layout_weight="1"
android:hint="Edit2"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:ems="10"
android:id="#+id/edi3"
android:background="#drawable/blueborder"
android:textColorHint="#FFFFFF"
android:textColor="#FFFFFF"
android:layout_marginLeft="25dp" android:layout_marginRight="25dp" android:layout_marginTop="6dp"
android:paddingTop="10dp" android:paddingBottom="10dp" android:paddingLeft="10dp"
android:layout_weight="1"
android:hint="Edit3"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:ems="10"
android:id="#+id/edit4"
android:background="#drawable/blueborder"
android:textColorHint="#FFFFFF"
android:textColor="#FFFFFF"
android:layout_marginLeft="25dp" android:layout_marginRight="25dp" android:layout_marginTop="6dp"
android:paddingTop="10dp" android:paddingBottom="10dp" android:paddingLeft="10dp"
android:layout_weight="1"
android:hint="Edit4"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textMultiLine|textPersonName"
android:ems="10"
android:id="#+id/edit5"
android:background="#drawable/blueborder"
android:textColorHint="#FFFFFF"
android:layout_marginLeft="25dp" android:layout_marginRight="25dp" android:layout_marginTop="6dp"
android:paddingTop="10dp" android:paddingBottom="20dp" android:paddingLeft="10dp"
android:layout_weight="3.33"
android:scrollbars="vertical" android:hint="Notatka" android:lines="2" android:textColor="#FFFFFF"/>
<CheckBox
android:text="Checkbox1"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="#+id/check1" android:layout_marginLeft="20dp"
android:textColor="#color/apptheme_color"
android:layout_weight="1"
/>
<CheckBox
android:text="Checkbox2"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="#+id/check2" android:layout_marginLeft="20dp"
android:textColor="#color/apptheme_color"
android:layout_weight="1"
/>
<Button
android:text="Save"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="#+id/button" android:layout_weight="2"
android:textColor="#02485a" android:background="#drawable/blackborder"
android:layout_marginLeft="25dp" android:layout_marginRight="25dp"
android:layout_marginBottom="16dp"/>
</LinearLayout>
</RelativeLayout>
</ScrollView>
Add ScrollView inside RelativeLayout with fillViewport property
<ScrollView
android:layout_width="match_parent"
android:fillViewport="true"
android:layout_height="match_parent">
</ScrollView>
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);
In my application i am using recycler view and scrollview in one layout. it is not working when i am using both these views. If i remove scroll view only the recycler view is working. Plese any one help me hoe to fix this issue.
my code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/r1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/background"
>
<ScrollView
android:id="#+id/sc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#1e356a">
<TextView
android:id="#+id/placce_head"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:text="Hyderabad to banglore"
android:textColor="#ffffff"
android:textSize="20dp" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#78869c"
android:weightSum="2"
android:orientation="horizontal">
<TextView
android:id="#+id/seats"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:text="Selected Seats"
android:textColor="#ffffff"
android:textSize="16dp" />
<TextView
android:id="#+id/totalamount"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:text="Total Amount"
android:textColor="#ffffff"
android:textSize="16dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#78869c"
android:weightSum="2"
android:orientation="horizontal">
<TextView
android:id="#+id/seat_num"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:textColor="#ffffff"
android:textSize="16dp" />
<TextView
android:id="#+id/total_amount"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="10dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:textColor="#ffffff"
android:textSize="16dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
android:id="#+id/boardingpoint_edttxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusableInTouchMode="false"
android:layout_marginLeft="30dp"
android:layout_marginTop="22dp"
android:background="#null"
android:hint=" Select Boarding Point"
android:textColorHint="#1e365a"
android:textSize="15dp" />
<View
android:layout_width="fill_parent"
android:layout_height="0.8dp"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:layout_marginTop="7dp"
android:background="#1e365a" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#78869c"
android:layout_marginTop="20dp">
<TextView
android:id="#+id/contact_details"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:text="Contact Details"
android:textColor="#ffffff"
android:textSize="20dp" />
</RelativeLayout>
<EditText
android:id="#+id/contactname_edt_txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="22dp"
android:background="#null"
android:hint="Contact Name"
android:textColorHint="#1e365a"
android:textSize="15dp" />
<View
android:layout_width="fill_parent"
android:layout_height="0.8dp"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:layout_marginTop="7dp"
android:background="#1e365a" />
<EditText
android:id="#+id/email_edt_txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="22dp"
android:background="#null"
android:hint="Email Address"
android:textColorHint="#1e365a"
android:textSize="15dp" />
<View
android:layout_width="fill_parent"
android:layout_height="0.8dp"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:layout_marginTop="7dp"
android:background="#1e365a" />
<EditText
android:id="#+id/contactnum_edt_txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="22dp"
android:background="#null"
android:hint="Contact Number"
android:textColorHint="#1e365a"
android:textSize="15dp" />
<View
android:layout_width="fill_parent"
android:layout_height="0.8dp"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:layout_marginTop="7dp"
android:background="#1e365a" />
<EditText
android:id="#+id/emergency_edt_txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="22dp"
android:background="#null"
android:hint="Emergency Contact Number"
android:textColorHint="#1e365a"
android:textSize="15dp" />
<View
android:layout_width="fill_parent"
android:layout_height="0.8dp"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:layout_marginTop="7dp"
android:background="#1e365a" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#78869c"
android:layout_marginTop="20dp">
<TextView
android:id="#+id/passenger_details"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:text="Passenger Details"
android:textColor="#ffffff"
android:textSize="20dp" />
</RelativeLayout>
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/view"
android:layout_below="#+id/sc"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<LinearLayout
android:id="#+id/coupon_lay"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="8dp"
android:layout_marginTop="12dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:weightSum="100" >
<EditText
android:id="#+id/entercouponcode_edt"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_weight="50"
android:hint="Enter coupn code"
android:inputType="text" >
<requestFocus />
</EditText>
<Button
android:id="#+id/bt_apply"
style="#style/payment_button_style"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_marginLeft="-5dp"
android:layout_weight="40"
android:gravity="center"
android:text="Apply" />
</LinearLayout>
<Button
android:id="#+id/pay_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="28dp"
android:layout_marginRight="30dp"
android:layout_marginTop="20dp"
android:background="#F93249"
android:duplicateParentState="true"
android:gravity="center"
android:paddingBottom="8dp"
android:paddingTop="8dp"
android:text="Proceed to Pay"
android:textColor="#ffffff"
android:textSize="20dp"/>
</LinearLayout>
</ScrollView>
</RelativeLayout>
you must know that ,your scrollview property is set as MatchParent ,which means it will fill the content view, so i suggest to set Height a real value such as 100dp, and it will work
You need to dynamically change the height of the recyclerview, depending on how many items you have.
int recyclerheight = height_per_item * adapterData.size();
recyclerView.getLayoutParams().height = recyclerheight;
The scroll view blocks the recyclerview from changing its height set in the xml, that's why you need to do it programically.
So I have the following layout
ScrollView
RelativeLayout
TextView1
EditText1
TextView2
EditText2
TextView3
EditText3
TextView4
EditText4
TextView5
EditText5:
android:id="#+id/txtPassword"
LinearLayout:
android:id="#+id/Linearlayout1"
layout_alignParentBottom="true"
Button1
Button2
Here's the problem
When I click the txtPassword EditText to enter some text Button1&Button2 from the LinearLayout overlaps or becomes on top of txtPassword
Someone suggested that I use android:layout_below="#id/txtPassword" for the Linear Layout but that makes the layout_alignParentBottom="true" useless because it will put the LinearLayout right below txtPassword and not at the bottom.
EDIT: Here's the Full Layout
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/signatureScroller"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true" >
<RelativeLayout
android:id="#+id/signatureLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFF"
android:orientation="vertical"
android:paddingBottom="20dp"
android:paddingLeft="10dp"
android:paddingRight="10dp" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="20dp"
android:text="#string/Meaning"
android:textColor="#000"
android:textSize="14sp" />
<EditText
android:id="#+id/txtMeaning"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_below="#+id/textView1"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="16dp"
android:ems="10"
android:enabled="false"
android:inputType="text|textMultiLine"
android:singleLine="true"
android:textColor="#505050"
android:textSize="14sp" >
</EditText>
<TextView
android:id="#+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_below="#+id/txtMeaning"
android:layout_marginTop="16dp"
android:text="#string/Comments"
android:textColor="#000"
android:textSize="14sp" />
<EditText
android:id="#+id/txtSignatureComments"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/TextView01"
android:layout_below="#+id/TextView01"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="16dp"
android:ems="10"
android:hint="#string/Comments"
android:inputType="textMultiLine"
android:maxLength="250"
android:singleLine="false"
android:textSize="14sp" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_below="#+id/textView1"
android:layout_marginTop="4dp"
android:contentDescription="#string/Image"
android:scaleType="fitXY"
android:src="#drawable/line2" />
<ImageView
android:id="#+id/ImageView01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/TextView01"
android:layout_below="#+id/TextView01"
android:layout_marginTop="4dp"
android:contentDescription="#string/Image"
android:scaleType="fitXY"
android:src="#drawable/line2" />
<TextView
android:id="#+id/txtDuration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/txtSignatureComments"
android:layout_marginTop="16dp"
android:text="#string/Duration2"
android:textColor="#000"
android:textSize="14sp" />
<ImageView
android:id="#+id/imgDuration"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/txtDuration"
android:layout_marginTop="4dp"
android:contentDescription="#string/Image"
android:scaleType="fitXY"
android:src="#drawable/line2" />
<EditText
android:id="#+id/txtHours"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/imgDuration"
android:layout_marginLeft="6dp"
android:layout_marginTop="16dp"
android:ems="10"
android:hint="#string/Hours"
android:inputType="number|textMultiLine"
android:singleLine="true"
android:textColor="#505050"
android:textSize="14sp" >
</EditText>
<EditText
android:id="#+id/txtMinutes"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/txtHours"
android:layout_alignParentRight="true"
android:layout_marginRight="6dp"
android:ems="10"
android:hint="#string/Minutes"
android:inputType="numberDecimal|text|textMultiLine"
android:singleLine="true"
android:textColor="#505050"
android:textSize="14sp" >
</EditText>
<TextView
android:id="#+id/txtException"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/txtHours"
android:layout_marginTop="16dp"
android:text="#string/Exception"
android:textColor="#000"
android:textSize="14sp" />
<ImageView
android:id="#+id/imgException"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/txtException"
android:layout_marginTop="4dp"
android:contentDescription="#string/Image"
android:scaleType="fitXY"
android:src="#drawable/line2" />
<Spinner
android:id="#+id/spnrException"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/imgException"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="16dp" />
<EditText
android:id="#+id/txtExceptionDesc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/spnrException"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="8dp"
android:ems="10"
android:inputType="textMultiLine"
android:maxLength="250"
android:singleLine="false"
android:textSize="14sp" >
</EditText>
<TextView
android:id="#+id/txtPerformance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/txtExceptionDesc"
android:layout_marginTop="16dp"
android:text="#string/PerformanceBased"
android:textColor="#000"
android:textSize="14sp" />
<ImageView
android:id="#+id/imgPerformance"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/txtPerformance"
android:layout_marginTop="4dp"
android:contentDescription="#string/Image"
android:scaleType="fitXY"
android:src="#drawable/line2" />
<Spinner
android:id="#+id/spnrPerformance"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/imgPerformance"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="16dp" />
<EditText
android:id="#+id/txtUsername"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/spnrPerformance"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="60dp"
android:ems="10"
android:hint="#string/Username"
android:inputType="textCapCharacters|textAutoComplete"
android:singleLine="true"
android:textAllCaps="true"
android:textSize="12sp" >
</EditText>
<EditText
android:id="#+id/txtPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/txtUsername"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="10dp"
android:ems="10"
android:hint="#string/Password"
android:inputType="textPassword"
android:singleLine="true"
android:textSize="12sp" />
<LinearLayout
android:id="#+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<Button
android:id="#+id/btnSave"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/button_detail_bg"
android:text="#string/Sign"
android:textColor="#drawable/button_detail_txt"
android:textSize="16sp"
android:textStyle="bold" />
<Button
android:id="#+id/btnCancel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/button_detail_bg"
android:text="#string/Cancel"
android:textColor="#drawable/button_detail_txt"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>
</ScrollView>
You might want to see if this can be fixed using different windowSoftInputMode settings. You could try to set
android:windowSoftInputMode="adjustPan" for this specific activity. It will than move up the UI if the keyboard is visible and focused on a edittext.
adjustResize can have the effect that some views overlap when the keyboard is visible.
use android:layout_below="#id/txtPassword" for the LinearLayout will work and doesn't make alignparentbottom="true" useless.
try it
<LinearLayout
android:id="#+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
layout_below="#id/txtPassword"
android:layout_alignParentBottom="true" >
When you use a Relative Layout and the Keyboard will be opened you LinearLayout will be above the keyboard
I'll suggest another solution and I think it will work:
Use a LinearLayout as parent and the last LinearLayout height fill parent and set the gravity bottom try this:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/signatureScroller"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true" >
<LinearLayout
android:id="#+id/signatureLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFF"
android:orientation="vertical"
android:paddingBottom="20dp"
android:paddingLeft="10dp"
android:paddingRight="10dp" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="#string/Meaning"
android:textColor="#000"
android:textSize="14sp" />
<EditText
android:id="#+id/txtMeaning"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="16dp"
android:ems="10"
android:enabled="false"
android:inputType="text|textMultiLine"
android:singleLine="true"
android:textColor="#505050"
android:textSize="14sp" >
</EditText>
<TextView
android:id="#+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="16dp"
android:text="#string/Comments"
android:textColor="#000"
android:textSize="14sp" />
<EditText
android:id="#+id/txtSignatureComments"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="16dp"
android:ems="10"
android:hint="#string/Comments"
android:inputType="textMultiLine"
android:maxLength="250"
android:singleLine="false"
android:textSize="14sp" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="4dp"
android:contentDescription="#string/Image"
android:scaleType="fitXY"
android:src="#drawable/line2" />
<ImageView
android:id="#+id/ImageView01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="4dp"
android:contentDescription="#string/Image"
android:scaleType="fitXY"
android:src="#drawable/line2" />
<TextView
android:id="#+id/txtDuration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="16dp"
android:text="#string/Duration2"
android:textColor="#000"
android:textSize="14sp" />
<ImageView
android:id="#+id/imgDuration"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="4dp"
android:contentDescription="#string/Image"
android:scaleType="fitXY"
android:src="#drawable/line2" />
<EditText
android:id="#+id/txtHours"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="6dp"
android:layout_marginTop="16dp"
android:ems="10"
android:hint="#string/Hours"
android:inputType="number|textMultiLine"
android:singleLine="true"
android:textColor="#505050"
android:textSize="14sp" >
</EditText>
<EditText
android:id="#+id/txtMinutes"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/txtHours"
android:layout_gravity="right"
android:layout_marginRight="6dp"
android:ems="10"
android:hint="#string/Minutes"
android:inputType="numberDecimal|text|textMultiLine"
android:singleLine="true"
android:textColor="#505050"
android:textSize="14sp" >
</EditText>
<TextView
android:id="#+id/txtException"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="16dp"
android:text="#string/Exception"
android:textColor="#000"
android:textSize="14sp" />
<ImageView
android:id="#+id/imgException"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="4dp"
android:contentDescription="#string/Image"
android:scaleType="fitXY"
android:src="#drawable/line2" />
<Spinner
android:id="#+id/spnrException"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="16dp" />
<EditText
android:id="#+id/txtExceptionDesc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="8dp"
android:ems="10"
android:inputType="textMultiLine"
android:maxLength="250"
android:singleLine="false"
android:textSize="14sp" >
</EditText>
<TextView
android:id="#+id/txtPerformance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="16dp"
android:text="#string/PerformanceBased"
android:textColor="#000"
android:textSize="14sp" />
<ImageView
android:id="#+id/imgPerformance"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="4dp"
android:contentDescription="#string/Image"
android:scaleType="fitXY"
android:src="#drawable/line2" />
<Spinner
android:id="#+id/spnrPerformance"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="16dp" />
<EditText
android:id="#+id/txtUsername"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="60dp"
android:ems="10"
android:hint="#string/Username"
android:inputType="textCapCharacters|textAutoComplete"
android:singleLine="true"
android:textAllCaps="true"
android:textSize="12sp" >
</EditText>
<EditText
android:id="#+id/txtPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/txtUsername"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="10dp"
android:ems="10"
android:hint="#string/Password"
android:inputType="textPassword"
android:singleLine="true"
android:textSize="12sp" />
<LinearLayout
android:id="#+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<Button
android:id="#+id/btnSave"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/button_detail_bg"
android:text="#string/Sign"
android:textColor="#drawable/button_detail_txt"
android:textSize="16sp"
android:textStyle="bold"
android:layout_gravity="bottom"
android:gravity="bottom" />
<Button
android:id="#+id/btnCancel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/button_detail_bg"
android:text="#string/Cancel"
android:textColor="#drawable/button_detail_txt"
android:textSize="16sp"
android:textStyle="bold"
android:layout_gravity="bottom"
android:gravity="bottom" />
</LinearLayout>
</LinearLayout>
</ScrollView>