I have created a layout with edit boxes ,textfields,buttons and images etc. But when i try to type something in my edit box the keyboard appears and my layout changes horribly .how can i fix this?
before keyboard appears
after keyboard appears
my layout
<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="#color/grey"
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=".MainActivity" >
<TextView
android:id="#+id/contactus_heading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="#string/cinema_contactus"
android:textColor="#000000"
android:textStyle="bold"
android:textSize="20dp" />
<EditText
android:id="#+id/contactus_name_edittext"
android:layout_width="340dp"
android:layout_height="40dp"
android:layout_above="#+id/contactus_email_edittext"
android:layout_alignLeft="#+id/contactus_email_edittext"
android:layout_alignRight="#+id/contactus_email_edittext"
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp"
android:background="#drawable/rounded_edittext"
android:ems="10"
android:hint="Name"
android:textSize="12sp" />
<EditText
android:id="#+id/contactus_email_edittext"
android:layout_width="340dp"
android:layout_height="40dp"
android:layout_above="#+id/contactus_message_edittext"
android:layout_marginBottom="20dp"
android:layout_toRightOf="#+id/fax"
android:background="#drawable/rounded_edittext"
android:ems="10"
android:hint="E-mail"
android:textSize="12sp" />
<EditText
android:id="#+id/contactus_message_edittext"
android:layout_width="340dp"
android:layout_height="115dp"
android:layout_above="#+id/contactus_submit_button"
android:layout_alignLeft="#+id/contactus_email_edittext"
android:layout_alignRight="#+id/contactus_email_edittext"
android:layout_marginBottom="20dp"
android:background="#drawable/rounded_edittext"
android:ems="10"
android:gravity="top|left"
android:hint="Message"
android:textSize="12sp" />
<Button
android:id="#+id/contactus_submit_button"
android:layout_width="125dp"
android:layout_height="40dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#drawable/mybutton"
android:text="#string/submit"
android:layout_marginBottom="30dp"
android:layout_marginTop="20dp"
android:textSize="14dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
</LinearLayout>
<ImageView
android:id="#+id/emailedit"
android:layout_width="45dp"
android:layout_height="40dp"
android:layout_alignTop="#+id/contactus_email_edittext"
android:layout_toLeftOf="#+id/contactus_email_edittext"
android:src="#drawable/emailtop" />
<ImageView
android:id="#+id/nameedit"
android:layout_width="45dp"
android:layout_height="40dp"
android:layout_alignTop="#+id/contactus_name_edittext"
android:layout_toLeftOf="#+id/contactus_name_edittext"
android:src="#drawable/nametop" />
<ImageView
android:id="#+id/messageedit"
android:layout_width="45dp"
android:layout_height="115dp"
android:layout_alignTop="#+id/contactus_message_edittext"
android:layout_toLeftOf="#+id/contactus_message_edittext"
android:src="#drawable/messagetop" />
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/contactus_submit_button"
android:layout_below="#+id/contactus_email_edittext"
android:orientation="horizontal" >
</LinearLayout>
<ImageView
android:id="#+id/fax"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_alignTop="#+id/contactus_telephone2"
android:layout_toLeftOf="#+id/contactus_telephone2"
android:layout_marginTop="3dp"
android:src="#drawable/fax" />
<ImageView
android:id="#+id/email"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_alignTop="#+id/contactus_email"
android:layout_toLeftOf="#+id/contactus_email"
android:layout_marginTop="3dp"
android:src="#drawable/message" />
<ImageView
android:id="#+id/telephone"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_alignTop="#+id/contactus_telephone1"
android:layout_toLeftOf="#+id/contactus_telephone1"
android:layout_marginTop="3dp"
android:src="#drawable/call" />
<ImageView
android:id="#+id/addresspointer"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_alignLeft="#+id/telephone"
android:layout_alignTop="#+id/contactus_address"
android:layout_marginTop="3dp"
android:src="#drawable/pointer" />
<TextView
android:id="#+id/contactus_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/contactus_submit_button"
android:layout_centerHorizontal="true"
android:text="#string/cinema_contactus_address"
android:textColor="#000000"
android:lineSpacingExtra="5dp"
android:textSize="14sp"
android:layout_marginTop="25dp" />
<TextView
android:id="#+id/contactus_telephone1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/contactus_address"
android:layout_below="#+id/contactus_address"
android:text="#string/cinema_contactus_telephone1"
android:textColor="#000000"
android:layout_marginTop="5dp"
android:textSize="14sp" />
<TextView
android:id="#+id/contactus_telephone2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/telephone"
android:layout_toRightOf="#+id/telephone"
android:text="#string/cinema_contactus_telephone2"
android:textColor="#000000"
android:layout_marginTop="5dp"
android:textSize="14sp" />
<TextView
android:id="#+id/contactus_email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/contactus_telephone2"
android:layout_below="#+id/contactus_telephone1"
android:text="#string/cinema_contactus_email"
android:textColor="#000000"
android:layout_marginTop="5dp"
android:textSize="14sp" />
</RelativeLayout>
try this
inside onCreate write
getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
Ok found the answer
i just had to add the following in my activity in manifest
android:windowSoftInputMode="adjustPan"
Related
I have a listview with edittext as row items inside scrollview.I have used on touch listener on listview so I can scroll the list inside scrollview.But unable to make a call to onItemClickListener or OnItemSelectedListener.
I have tried android:windowSoftInputMode="adjustPan".
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/rlHamburger"
android:layout_width="50dp"
android:layout_height="match_parent" >
<Button
android:id="#+id/btnHamburger"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_centerInParent="true"
android:background="#drawable/images" />
</RelativeLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toRightOf="#+id/rlHamburger" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/rlTitle"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="5dp"
android:background="#drawable/relative_background" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_margin="10dp"
android:text="Add Quote"
android:textColor="#color/black"
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlButtons"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_below="#id/rlTitle"
android:layout_margin="5dp"
android:orientation="horizontal" >
<Button
android:id="#+id/btnBack"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:layout_gravity="center_vertical"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="#drawable/button"
android:gravity="center"
android:text="Back"
android:textColor="#drawable/text_color" />
<Button
android:id="#+id/btnAddPhoto"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:layout_margin="5dp"
android:layout_toLeftOf="#+id/btnAddNote"
android:layout_weight="1"
android:background="#drawable/button"
android:gravity="center"
android:text="Add Photo"
android:textColor="#drawable/text_color" />
<Button
android:id="#+id/btnAddNote"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:layout_margin="5dp"
android:layout_toLeftOf="#+id/btnSave"
android:layout_weight="1"
android:background="#drawable/button"
android:gravity="center"
android:text="Add Note"
android:textColor="#drawable/text_color" />
<Button
android:id="#+id/btnSave"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_gravity="center_vertical"
android:layout_margin="5dp"
android:background="#drawable/button"
android:gravity="center"
android:text="Save"
android:textColor="#drawable/text_color" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlInformation"
android:layout_width="match_parent"
android:layout_height="180dp"
android:layout_below="#id/rlButtons"
android:layout_margin="5dp"
android:background="#drawable/relative_background"
android:orientation="horizontal"
android:padding="5dp" >
<RelativeLayout
android:id="#+id/rlInfo1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="2dp" >
<TextView
android:id="#+id/title"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="Title" />
<EditText
android:id="#+id/tvTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/title"
android:background="#drawable/relative_background"
android:hint="Title"
android:padding="5dp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlInfo2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/rlInfo1"
android:layout_margin="2dp" >
<TextView
android:id="#+id/owner"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="Owner" />
<EditText
android:id="#+id/tvOwner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/owner"
android:background="#drawable/relative_background"
android:hint="Owner"
android:padding="5dp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlInfo3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/rlInfo2"
android:layout_margin="2dp" >
<TextView
android:id="#+id/address"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="Address" />
<EditText
android:id="#+id/tvAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/address"
android:background="#drawable/relative_background"
android:hint="Address"
android:padding="5dp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlInfo4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/rlInfo3"
android:layout_margin="2dp" >
<TextView
android:id="#+id/status"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="Status" />
<TextView
android:id="#+id/tvStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="#id/status"
android:text="Status" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlInfo5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/rlInfo4"
android:layout_margin="2dp" >
<TextView
android:id="#+id/description"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="Description" />
<EditText
android:id="#+id/tvDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/description"
android:background="#drawable/relative_background"
android:hint="Description"
android:padding="5dp" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/rlInformation"
android:layout_margin="10dp" >
<TextView
android:id="#+id/tvProductName"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Product Name" />
<TextView
android:id="#+id/tvShortDescription"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/tvProductName"
android:gravity="center"
android:text="Short Description" />
<TextView
android:id="#+id/tvQuantity"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/tvShortDescription"
android:gravity="center"
android:text="Qty" />
<TextView
android:id="#+id/tvUnits"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/tvQuantity"
android:gravity="center"
android:text="units" />
<TextView
android:id="#+id/tvPrice"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/tvUnits"
android:gravity="center"
android:text="Price" />
<TextView
android:id="#+id/tvTotal"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:gravity="center"
android:text="Total" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlList1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/rlList"
android:layout_margin="10dp" >
<ListView
android:id="#+id/lvItems"
android:layout_width="match_parent"
android:layout_height="300dp" >
</ListView>
<Button
android:id="#+id/btnAddItem"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_below="#id/lvItems"
android:background="#drawable/button"
android:text="Add item"
android:textColor="#drawable/text_color" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/rlList1"
android:layout_margin="20dp" >
<TextView
android:id="#+id/tvTotalEstimation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:gravity="center"
android:text="Total estimation"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/tvEstimationValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#id/tvTotalEstimation"
android:gravity="center"
android:text="$0.0"
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
</RelativeLayout>
Here is the screenshot of my layout:
Please help me with the solution.Thanks.
Go to your manifest file and add these steps with activity tag of your class
android:configChanges="keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize|stateAlwaysHidden"
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 a ListView that I'm populating with an ArrayAdapter.Its work fine most of devices.But i have one karbonn(320x480) device which unable to display list.My application contain many listview they display properly on karbonn.
My .xml file
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#e6f0f5"
tools:context=".Save_educationActivity" >
<RelativeLayout
android:id="#+id/btnlayout"
android:layout_width="match_parent"
android:layout_height="47dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="#4791FF"
android:orientation="horizontal" >
<ImageButton
android:id="#+id/xibtn_save_education"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="5dp"
android:background="#4791FF"
android:src="#drawable/ic_action_save" />
<ImageButton
android:id="#+id/xibtn_back_to_education"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:background="#4791FF"
android:src="#drawable/ic_action_back" />
</RelativeLayout>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/btnlayout"
android:layout_marginTop="3dp"
android:text="#string/Education_title" />
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/textView1" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" Course Name"
android:textSize="18dp"
android:textStyle="bold" />
</RelativeLayout>
</ScrollView>
<EditText
android:id="#+id/xedt_course"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/scrollView1"
android:ems="10"
android:inputType="textPersonName" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/xedt_course"
android:text="Date"
android:textSize="18dp"
android:textStyle="bold" />
<TextView
android:id="#+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView3"
android:text="Joining Date"
android:textSize="18dp" />
<TextView
android:id="#+id/TextView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/TextView01"
android:layout_alignBottom="#+id/TextView01"
android:layout_alignLeft="#+id/lvdate"
android:text="Leave Date"
android:textSize="18dp" />
<EditText
android:id="#+id/jdate"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/TextView01"
android:ems="10"
android:hint="Joining Date"
android:inputType="textPersonName" />
<EditText
android:id="#+id/lvdate"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/TextView02"
android:ems="10"
android:hint="Leaving Date"
android:inputType="textPersonName" >
<requestFocus />
</EditText>
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_below="#+id/jdate"
android:layout_marginTop="10dp"
android:background="#ffffff"
android:orientation="horizontal" >
<Button
android:id="#+id/btn_education_desc"
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:background="#drawable/date_stroke"
android:text="Add Description"
android:textColor="#ffffff"
android:textSize="20dp" />
<ImageButton
android:id="#+id/add_edu_desc"
android:layout_width="70dp"
android:layout_height="match_parent"
android:background="#drawable/date_stroke"
android:src="#drawable/ic_action_new"
android:visibility="gone" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/linearLayout1">
<ListView
android:id="#+id/lst_eductndesc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true" >
</ListView>
</RelativeLayout>
</RelativeLayout>
You have very buggy layout. I will show you tour mistakes:
<RelativeLayout
android:id="#+id/btnlayout"
android:layout_width="match_parent"
android:layout_height="47dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="#4791FF"
android:orientation="horizontal" > // there is no such attribute in relative layout
<ImageButton
android:id="#+id/xibtn_save_education"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="5dp"
android:background="#4791FF"
android:src="#drawable/ic_action_save" />
<ImageButton
android:id="#+id/xibtn_back_to_education"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:background="#4791FF"
android:src="#drawable/ic_action_back" />
</RelativeLayout>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/btnlayout"
android:layout_marginTop="3dp"
android:text="#string/Education_title" />
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" // which size of scroll view you expected here? It will grow with their content and never have scroll.
android:layout_below="#+id/textView1" >
<RelativeLayout // you don't need to have relative layout here.
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" Course Name"
android:textSize="18dp"
android:textStyle="bold" />
</RelativeLayout>
</ScrollView>
<EditText
android:id="#+id/xedt_course"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/scrollView1"
android:ems="10"
android:inputType="textPersonName" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/xedt_course"
android:text="Date"
android:textSize="18dp"
android:textStyle="bold" />
<TextView
android:id="#+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView3"
android:text="Joining Date"
android:textSize="18dp" />
<TextView
android:id="#+id/TextView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/TextView01"
android:layout_alignBottom="#+id/TextView01"
android:layout_alignLeft="#+id/lvdate"
android:text="Leave Date"
android:textSize="18dp" />
<EditText
android:id="#+id/jdate"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/TextView01"
android:ems="10"
android:hint="Joining Date"
android:inputType="textPersonName" />
<EditText
android:id="#+id/lvdate"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/TextView02"
android:ems="10"
android:hint="Leaving Date"
android:inputType="textPersonName" >
<requestFocus />
</EditText>
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_below="#+id/jdate"
android:layout_marginTop="10dp"
android:background="#ffffff"
android:orientation="horizontal" >
<Button
android:id="#+id/btn_education_desc"
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:background="#drawable/date_stroke"
android:text="Add Description"
android:textColor="#ffffff"
android:textSize="20dp" />
<ImageButton
android:id="#+id/add_edu_desc"
android:layout_width="70dp"
android:layout_height="match_parent"
android:background="#drawable/date_stroke"
android:src="#drawable/ic_action_new"
android:visibility="gone" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" // which height you expect here? It will have height the same as parent, but draws somewhere at the bottom. It will draw a large part of view outside of screen.
android:layout_below="#+id/linearLayout1">
<ListView
android:id="#+id/lst_eductndesc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true" >
</ListView>
</RelativeLayout>
I think you need reformat your layout at all. If you will show image what you want to achieve and explain it's behavior, I will help to write more effeicient and clean xml.
You can make your layout like this:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#e6f0f5"
tools:context=".Save_educationActivity"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/btnlayout"
android:layout_width="match_parent"
android:layout_height="47dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="#4791FF"
android:orientation="horizontal" > // there is no such attribute in relative layout
<ImageButton
android:id="#+id/xibtn_save_education"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="5dp"
android:background="#4791FF"
android:src="#drawable/ic_action_save" />
<ImageButton
android:id="#+id/xibtn_back_to_education"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:background="#4791FF"
android:src="#drawable/ic_action_back" />
</RelativeLayout>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:text="#string/Education_title" />
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="50dp" // you must declare your height exactly here
>
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" Course Name"
android:textSize="18dp"
android:textStyle="bold" />
</ScrollView>
<EditText
android:id="#+id/xedt_course"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/scrollView1"
android:ems="10"
android:inputType="textPersonName" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/xedt_course"
android:text="Date"
android:textSize="18dp"
android:textStyle="bold" />
<LinearLayout layout_width="match_parent"
layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout layout_width="0dp"
laout_weight="1"
layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView3"
android:text="Joining Date"
android:textSize="18dp" />
<EditText
android:id="#+id/jdate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Joining Date"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout layout_width="0dp"
laout_weight="1"
layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/TextView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Leave Date"
android:textSize="18dp" />
<EditText
android:id="#+id/lvdate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Leaving Date"
android:inputType="textPersonName" >
</EditText>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="10dp"
android:background="#ffffff"
android:orientation="horizontal" >
<Button
android:id="#+id/btn_education_desc"
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:background="#drawable/date_stroke"
android:text="Add Description"
android:textColor="#ffffff"
android:textSize="20dp" />
<ImageButton
android:id="#+id/add_edu_desc"
android:layout_width="70dp"
android:layout_height="match_parent"
android:background="#drawable/date_stroke"
android:src="#drawable/ic_action_new"
android:visibility="gone" />
</LinearLayout>
<ListView
android:id="#+id/lst_eductndesc"
android:layout_width="match_parent"
android:layout_height="0dp"
layout_weight="1"
android:layout_centerHorizontal="true" >
</LinearLayout>
Since you're using RelativeLayouts and aligning your views beneath one another, it's likely that the layout is extending beyond the bottom of the screen.
I encourage you to use a different combination of ViewGroups, for instance using a vertically oriented LinearLayout inside a ScrollView.
I have a layout for ldpi with some elements inside a scrowview.
I have two edittexts and when I click one of then, the keyboard
is overriding the edittext. Its haoening only in this screen and only in
this size of screnn. I have others layouts files with edittexts and It happens
only in this layout.
This is the code:
<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"
tools:context=".NovoCheckinActivity" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="67dp"
android:layout_weight="0.03"
android:background="#drawable/header"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="#+id/imgVoltaNovoCheckin"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="7dp"
android:layout_marginTop="13dp"
android:src="#drawable/bt_back"
android:onClick="voltaNovoCheckin"/>
<TextView
android:id="#+id/labelAutenticacaoNovoCheckin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/imgVoltaNovoCheckin"
android:layout_marginLeft="10dp"
android:layout_toRightOf="#+id/imgVoltaNovoCheckin"
android:text="Novo Check-in"
android:textColor="#android:color/white"
android:textSize="18sp" />
<TextView
android:id="#+id/tvEventoClienteNovoCheckin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/imgVoltaNovoCheckin"
android:layout_marginLeft="10dp"
android:layout_toRightOf="#+id/imgVoltaNovoCheckin"
android:text="Reuniao - Porto Seguro"
android:textColor="#android:color/white" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="8"
android:orientation="vertical" >
<ScrollView
android:layout_width="wrap_content"
android:layout_height="380dp" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="410dp"
android:focusableInTouchMode="true"
android:layout_weight="1.03" >
<TextView
android:id="#+id/labelTipoCheckin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="24dp"
android:layout_marginTop="5dp"
android:text="Tipo:"
android:textColor="#333333" />
<Button
android:id="#+id/btTipoCheckin"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_below="#+id/labelTipoCheckin"
android:layout_centerHorizontal="true"
android:layout_marginLeft="50dp"
android:layout_marginTop="2dp"
android:background="#drawable/borda_botao"
android:hint="Chegada/Saída/Presença" />
<Button
android:id="#+id/btLocal"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_below="#+id/labelLocal"
android:layout_centerHorizontal="true"
android:layout_marginLeft="50dp"
android:layout_marginTop="2dp"
android:background="#drawable/borda_botao"
android:hint="Empresa/Cliente/Minha Casa" />
<EditText
android:id="#+id/etObservacoesNovoCheckin"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_below="#+id/labelObservacoes"
android:layout_centerHorizontal="true"
android:layout_marginLeft="50dp"
android:layout_marginTop="2dp"
android:background="#drawable/borda_botao"
android:paddingLeft="5dp" >
</EditText>
<TextView
android:id="#+id/labelLocal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/labelTipoCheckin"
android:layout_below="#+id/btTipoCheckin"
android:text="Local:"
android:textColor="#333333" />
<EditText
android:id="#+id/etCustoNovoCheckin"
android:layout_width="match_parent"
android:layout_height="38dp"
android:layout_below="#+id/labelCustoNovoCheckin"
android:layout_centerHorizontal="true"
android:layout_marginLeft="50dp"
android:background="#drawable/borda_botao"
android:inputType="numberDecimal"
android:paddingLeft="5dp" />
<Button
android:id="#+id/btSalvarNovoCheckin"
android:layout_width="150dp"
android:layout_height="35dp"
android:layout_below="#+id/etCustoNovoCheckin"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:layout_weight="0.03"
android:background="#drawable/bt_green"
android:text="Salvar"
android:textColor="#android:color/white"
android:textSize="20sp" />
<TextView
android:id="#+id/labelObservacoes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/labelLocal"
android:layout_below="#+id/btLocal"
android:layout_marginTop="10dp"
android:text="Observações:"
android:textColor="#333333" />
<TextView
android:id="#+id/labelCustoNovoCheckin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/btCheck"
android:layout_below="#+id/btCheck"
android:layout_marginTop="10dp"
android:text="Custo:"
android:textColor="#333333" />
<ImageView
android:id="#+id/invisible"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignRight="#+id/labelTipoCheckin"
android:layout_alignTop="#+id/btCheck"
android:src="#drawable/invisible" />
<TextView
android:id="#+id/labelCheck"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/invisible"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/labelCustoNovoCheckin"
android:text="Último Check-in do evento?"
android:textSize="13sp" />
<ImageView
android:id="#+id/btCheck"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_alignRight="#+id/invisible"
android:layout_below="#+id/etObservacoesNovoCheckin"
android:layout_marginTop="10dp"
android:background="#drawable/btunchecked" />
</RelativeLayout>
</ScrollView>
</LinearLayout>
take a look at the activity android:windowSoftInputMode modes to help with your adjustment of items on screen
In my app am using customized listed view with text view and Buttons.The screen size is 4.65" 720p(720X1280 : xhdpi),device take this resolution from layout-large folder.when i run it on device.the list view item and header display not fit to the screen like image shown below,some empty space in the end of row.Its not able to fit to the screen.Can any one know please help me to solve this issue.
Header XML Coding
<RelativeLayout
android:id="#+id/relativeLayout1"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="#+id/search_lay"
android:layout_marginTop="1dp"
android:background="#e8e8e8" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="32dp"
android:text="Item(s)"
android:textColor="#dd1713"
android:textSize="13sp" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="48dp"
android:layout_toRightOf="#+id/textView1"
android:text="Price(Rs.)"
android:textColor="#dd1713"
android:textSize="13sp" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="18dp"
android:layout_toRightOf="#+id/textView3"
android:text="Qty"
android:textColor="#dd1713"
android:textSize="13sp" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="28dp"
android:layout_toRightOf="#+id/textView2"
android:text="Total(Rs.)"
android:textColor="#dd1713"
android:textSize="13sp" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="3dp"
android:text="Fav"
android:textColor="#dd1713"
android:textSize="13sp" />
</RelativeLayout>
Customized List-view XML Coding
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="#ffffff" >
<TextView
android:id="#+id/orderlist_product_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:visibility="gone" />
<RelativeLayout
android:layout_width="30dp"
android:layout_height="match_parent" >
<ImageView
android:id="#+id/fav_img"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="#drawable/fav_order_list_btn" />
<Button
android:id="#+id/special_inst_btn"
android:layout_width="25dp"
android:layout_height="18dp"
android:layout_below="#+id/fav_img"
android:layout_centerHorizontal="true"
android:background="#drawable/special_inst_btn_in_orderlist"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
android:textSize="14sp" />
</RelativeLayout>
<TextView
android:id="#+id/order_list_itemname"
android:layout_width="95dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="1dp"
android:text="Item name"
android:textColor="#000000"
android:textSize="12sp"
android:typeface="serif" />
<RelativeLayout
android:layout_width="34dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp" >
<TextView
android:id="#+id/orderlist_offer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="4dp"
android:gravity="center"
android:textColor="#298616"
android:textSize="10sp" />
<TextView
android:id="#+id/orderlist_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:gravity="right"
android:text="200.00"
android:textColor="#000000"
android:textSize="10sp"
android:typeface="serif" />
</RelativeLayout>
<Button
android:id="#+id/orderlist_minus"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginTop="1dp"
android:background="#drawable/sub_button_click" />
<EditText
android:id="#+id/order_list_quantity"
android:layout_width="27dp"
android:layout_height="25dp"
android:layout_marginTop="13dp"
android:background="#drawable/et_bg"
android:ems="10"
android:focusable="false"
android:focusableInTouchMode="false"
android:gravity="center"
android:inputType="number"
android:textColor="#000000"
android:textSize="12dp"
android:typeface="serif" >
<requestFocus />
</EditText>
<Button
android:id="#+id/orderlist_plus"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:layout_marginTop="1dp"
android:background="#drawable/plus_btn_click" />
<TextView
android:id="#+id/orderlist_total"
android:layout_width="43dp"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginTop="13dp"
android:gravity="right"
android:text="1000.00"
android:textColor="#000000"
android:textSize="11sp"
android:typeface="serif" />
<Button
android:id="#+id/orderlist_delete"
android:layout_width="23dp"
android:layout_height="23dp"
android:layout_gravity="center"
android:layout_marginLeft="3dp"
android:layout_marginTop="1dp"
android:background="#drawable/order_list_delete" />
</LinearLayout>
</RelativeLayout>
i m giving u a demo.this layout will work on all size layout,this will definitely help u #Yugesh.
weight works percentage-wise on all screen.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical" >
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".30"
android:gravity="center_horizontal" >
<ImageView
android:id="#+id/image1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_launcher" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/image1"
android:src="#drawable/ic_launcher" />
</RelativeLayout>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".30"
android:text="30%" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".20"
android:text="20%" />
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".20"
android:text="20%" />
</LinearLayout>
</RelativeLayout>
further more,if there is any query,then please ask...