I have the layout below, which when the software keyboard opens the bottom buttons move up and all get squished together.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:background="#ffffff">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:orientation="vertical"
android:padding="10dip" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="70dp"
android:src="#drawable/banner" />
<TextView
android:id="#+id/erroremail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="TEST"
android:textColor="#D80000" />
<EditText
android:id="#+id/email_logout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:inputType="textEmailAddress"
android:singleLine="true"
android:hint="Email address" >
<requestFocus />
</EditText>
<EditText
android:id="#+id/password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:password="true"
android:singleLine="true"
android:hint="Password" />
<Button
android:id="#+id/btnLogin"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:background="#color/background"
android:height="50dp"
android:text="Sign In"
android:textColor="#FFF"
android:textSize="16sp" />
<TextView
android:id="#+id/forgottenpassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingTop="10dp"
android:text="Forgotten password?" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dip"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="10dp"
android:orientation="vertical" >
<Button
android:id="#+id/fbshare"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:background="#3B5998"
android:drawableLeft="#drawable/facebooklogo"
android:height="50dp"
android:text="Log in with Facebook"
android:textColor="#FFF"
android:textSize="16sp" />
<TextView
android:id="#+id/get_started"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:background="#color/background"
android:gravity="center"
android:height="50dp"
android:text="Sign Up"
android:textColor="#fff"
android:textSize="16sp" />
</LinearLayout>
</RelativeLayout>
</ScrollView>
I have set android:windowSoftInputMode="adjustPan" in the manifest but this does not seem to have changed anything.
Testing on my Note 3 with android 4.3
Is there another way I need to force the view to not get pushed together and just have the software keyboard lay on top of the view
Please put android:windowSoftInputMode="stateAlwaysHidden|adjustPan" inside activity tag of manifest file
Related
I am having a settings page in my application.In potrait all the fields are showing properly but when I switch to landscape mode the fields height are reducing and the hint of the fields are hiding which is not what I want.
I dont why it is happening.
It is my xml file:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/layoutsettings"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<Button
android:id="#+id/Button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="40sp"
android:layout_marginRight="40sp"
android:gravity="center_horizontal"
android:padding="10sp"
android:text="Signin with FB" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<EditText
android:id="#+id/UserFirstName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:hint="FName"
android:textSize="15sp" />
<EditText
android:id="#+id/UserLastName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:hint="LName"
android:textSize="15sp" />
</LinearLayout>
<EditText
android:id="#+id/PhoneNumber"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="PhoneNumber"
android:inputType="number"
android:phoneNumber="true"
android:textSize="15sp" />
<EditText
android:id="#+id/EmailAddress"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="EmailAddress"
android:textSize="15sp" />
<EditText
android:id="#+id/AddressLine1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="Address Line 1"
android:textSize="15sp" />
<EditText
android:id="#+id/AddressLine2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="Address Line 2"
android:textSize="15sp" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<EditText
android:id="#+id/Locality"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:hint="Locality"
android:textSize="15sp" />
<EditText
android:id="#+id/City"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:hint="City"
android:textSize="15sp" />
</LinearLayout>
<EditText
android:id="#+id/PinCode"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:height="30dp"
android:layout_weight="0.5"
android:hint="PinCode"
android:inputType="number"
android:textSize="15sp" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/Feedback"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Feedback"
android:textSize="17sp"
android:layout_marginLeft="20dp" />
<RatingBar
android:id="#+id/ratingbar"
style="#style/CustomRatingBar"
android:layout_width="wrap_content"
android:layout_height="50px"
android:layout_marginRight="20sp" />
</LinearLayout>
</LinearLayout>
If anybody can tell me what to do.
Thanks.
You need to create another folder in res called layout-land and add the same xml with the same code and arrange it accordingly. Then when you rotate your device/emulator then the xml in layout-land will inflate on your device/emulator
i am implementing one data enter screen with many fields.so that i am using scrolling view in my layout.But i want to draw OK button always.but i am unable to lock the some part of the screen.
i need secreen as:
but i am getting picture as either
or
i am adding my layout code below(as shown in last pic) plesae help me .
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ScrollView
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="#2E9AFE" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="Present Details"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColorHint="#350924"
android:textStyle="bold" />
<TextView
android:id="#+id/tvtv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Present Location"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#350924"
android:textStyle="bold" />
<ProgressBar
android:id="#+id/progressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
<EditText
android:id="#+id/etPreLoc1"
android:layout_width="fill_parent"
android:layout_height="120dp"
android:layout_gravity="center"
android:ems="10"
android:hint="Where are u now?"
android:inputType="textPostalAddress" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/etPreLoc1"
android:layout_gravity="center"
android:text="Coming By"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#350924"
android:textStyle="bold" />
<EditText
android:id="#+id/mmsComing"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:ems="10"
android:hint="car/auto/other" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Vehicle details"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#350924"
android:textStyle="bold" />
<EditText
android:id="#+id/etDriver"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:ems="10"
android:hint="Driver name/vehicle no"
android:inputType="textPersonName" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="Expected time to reach by:"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#350924"
android:textStyle="bold" />
<TimePicker
android:id="#+id/timePicker2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:layout_weight="75" />
</LinearLayout>
</ScrollView>
<Button
android:id="#+id/mmsOk"
android:layout_width="fill_parent"
android:layout_height="64dp"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="10dp"
android:layout_weight="25"
android:background="#drawable/blackbutton"
android:text="OK"
android:textColor="#android:color/white"
android:textSize="32dp"
android:textStyle="bold" />
</LinearLayout>
You can do that with a RelativeLayout like that. Just put all you views in the linearlayout inside the scrollview.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true" >
<Button
android:id="#+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>
</RelativeLayout>
Change scrollview height to 0dp and give weight as 1.
Change button layout gravity to bottom instead of center.
I'm trying to get the ListView to remain the same size even if it overflows. However, once the ListView overflows, it pushes the buttons below off the screen. How do I prevent it from pushing other elements that are below it?
As you can see from the above images, the second shows that the buttons get pushed off the screen once the ListView overflows.
XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="#color/splash_bg"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:background="#color/splash_bg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="10dp"
android:orientation="vertical" >
<TextView
android:id="#+id/subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="20sp"
android:paddingBottom="10dp"
android:textColor="#color/splash_text"
android:text="#string/sub" />
<EditText
android:id="#+id/grp_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="#string/field1"
android:lines="1" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="#+id/members"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:textSize="15sp"
android:paddingTop="5dp"
android:textColor="#color/splash_text"
android:text="#string/members" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#color/splash_bg"
android:orientation="horizontal" >
<EditText
android:id="#+id/name"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="#string/field2" />
<Button
android:id="#+id/add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/add" />
</LinearLayout>
<ListView
android:id="#android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:background="#color/splash_bg" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="bottom"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingBottom="5dp"
android:paddingTop="10dp" >
<Button
android:id="#+id/save_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="5"
android:text="Save" />
<Button
android:id="#+id/cancel_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Cancel" />
</LinearLayout>
Changet
<ListView
android:id="#android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:background="#color/splash_bg" />
to
<ListView
android:id="#android:id/list"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:paddingLeft="5dp"
android:background="#color/splash_bg" />
You can use a relative layout for this. Modify the below according to your needs
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginRight="11dp"
android:layout_marginTop="11dp"
android:text="Create New Group" />
<EditText
android:id="#+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="#+id/textView1"
android:layout_marginTop="23dp"
android:ems="10"
android:inputType="textPersonName" >
<requestFocus />
</EditText>
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editText1"
android:layout_marginLeft="11dp"
android:layout_marginTop="18dp"
android:text="Members" />
<EditText
android:id="#+id/editText2"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignRight="#+id/textView1"
android:layout_below="#+id/textView2"
android:layout_marginTop="31dp"
android:ems="10" />
<ListView
android:id="#android:id/list"
android:layout_above="#+id/button1"
android:layout_below="#+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
/>
<Button
android:id="#+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/editText2"
android:layout_alignBottom="#+id/editText2"
android:layout_alignParentRight="true"
android:layout_marginRight="13dp"
android:text="ADD" />
<Button
android:id="#+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/button3"
android:layout_below="#android:id/list"
android:text="Cancel" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_toLeftOf="#+id/textView1"
android:text="Save" />
</RelativeLayout>
I added this line : android:layout_weight="1" to the LinearLayout where EditText exist (my problem source) and the problem is gone !
look at the code where I commented <!-- HERE!!! -->
LOL I know i'm very late to answer this Q ,, sorry ,, but for anyone who is still struggling !
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="#+id/linearLayout1">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="ID : "
android:layout_margin="#dimen/EdgeMargins"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:ems="10"
android:id="#+id/editText"
android:layout_margin="#dimen/EdgeMargins"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/linearLayout2"
android:layout_weight="1"> <!-- HERE!!! -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Any Notes :"
android:id="#+id/textView2"
android:layout_margin="#dimen/EdgeMargins"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/editText2"
android:layout_margin="#dimen/EdgeMargins" />
</LinearLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Done"
android:id="#+id/button"
android:layout_margin="#dimen/EdgeMargins" />
</LinearLayout>
i had my problem with the highlighted EditText in the pic ,,, it expands with the entered text and pushes the DONE Button down !
I know my solution may look so silly but I took a whole day to solve this !
Hope it helps ^_^ GL
I am having a lot of trouble with the keypad not showing up.
I have a simple layout with all number EditText views - but (a) no keypad shows up for the first EditText field and then only the alpha pad shows up for the remaining ones. Is this a bug.
Here's the layout file:
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/lbBOS_previous"
android:layout_height="wrap_content"
android:layout_width="200dp"
android:paddingLeft="5dip"
android:paddingBottom="10dip"
android:text="#string/empties_bos_before"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<EditText
android:id="#+id/etBOS_previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:enabled="false"
android:focusable="false"
android:ems="10"
android:inputType="number" >
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/lbBottleSales"
android:layout_height="wrap_content"
android:layout_width="200dp"
android:paddingLeft="5dip"
android:paddingBottom="10dip"
android:text="#string/empties_bottleSales"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<EditText
android:id="#+id/etBottlesBought"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:enabled="false"
android:focusable="false"
android:ems="10"
android:inputType="number" >
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/lbEmpties"
android:layout_height="wrap_content"
android:paddingLeft="5dip"
android:layout_width="200dp"
android:paddingBottom="10dip"
android:text="#string/empties_pickup"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<EditText
android:id="#+id/etEmptiesPU"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:ems="10"
android:inputType="number" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/lbBOS_after"
android:layout_height="wrap_content"
android:layout_width="200dp"
android:paddingLeft="5dip"
android:paddingBottom="10dip"
android:text="#string/empties_bos_after"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<EditText
android:id="#+id/etBOSAfter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:ems="10"
android:inputType="number" >
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/lbCoolers"
android:layout_height="wrap_content"
android:layout_width="200dp"
android:paddingLeft="5dip"
android:paddingBottom="10dip"
android:text="#string/empties_coolers"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<EditText
android:id="#+id/etCoolersPU"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:ems="10"
android:inputType="number" >
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/lbracks"
android:layout_height="wrap_content"
android:layout_width="200dp"
android:paddingLeft="5dip"
android:paddingBottom="10dip"
android:text="#string/empties_racks"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<EditText
android:id="#+id/etRacksPU"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:ems="10"
android:inputType="number" >
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/lbemptiesWarning"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:paddingLeft="5dip"
android:paddingBottom="10dip"
android:text="#string/empties_saveWarning"
android:textSize="10sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom">
<Button
android:id="#+id/cmdDoneEmpties"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/cmd_done" />
</LinearLayout>
</LinearLayout>
You have set android:enabled to false one the first two EditText's, and on the other ones you have explicitly asked it to only show the numberpad, by specifying android:inputType="number". So the behavior is totally correct.
Edit: Ahh sorry misread your question a bit. To actually have the number pad showing up you have to target Android 1.5 and up. You should also be able to limit what characters are shown by doing something like this:
<EditText
android:inputType="phone"
android:digits="1234567890"
...
/>
I've got an issue with the keyboard overlapping my layout. When Android brings up the keyboard, it overlaps some of my layout and hides them.
Is there any way to stop it from doing this?
Example images:
Here is my xml layout code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_margin="5dip"
android:text="#string/email_provider_text" />
<RadioGroup
android:id="#+id/radioEmailProvider"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal" >
<RadioButton
android:id="#+id/radioYahoo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14dip"
android:checked="true"
android:text="#string/radio_selection_yahoo" />
<RadioButton
android:id="#+id/radioGmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:textSize="14dip"
android:text="#string/radio_selection_gmail" />
</RadioGroup>
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/linearLayout1" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_margin="5dip"
android:text="#string/txt_to_email" />
<EditText
android:id="#+id/edtToAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="32dip"
android:layout_marginRight="5dip"
android:gravity="center_vertical"
android:hint="#string/to_email_hint"
android:inputType="textEmailAddress"
android:textSize="14dip" >
</EditText>
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/linearLayout2" >
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_margin="5dip"
android:text="#string/txt_subject_email" />
<EditText
android:id="#+id/edtSubject"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="5dip"
android:gravity="center_vertical"
android:inputType="text"
android:textSize="14dip" />
</LinearLayout>
<CheckBox
android:id="#+id/checkAttachment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:layout_alignParentLeft="true"
android:layout_below="#+id/linearLayout3" />
<EditText
android:id="#+id/edtBodyPart"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/linearLayout4"
android:layout_alignParentLeft="true"
android:layout_below="#+id/checkAttachment"
android:gravity="top"
android:inputType="textMultiLine"
android:textSize="14dip" >
<requestFocus />
</EditText>
<LinearLayout
android:id="#+id/linearLayout4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true" >
<Button
android:id="#+id/btnSend"
android:layout_width="0dp"
android:layout_height="40dip"
android:layout_gravity="center_vertical"
android:layout_marginRight="5dip"
android:layout_weight="1"
android:text="#string/btn_send_email" />
<Button
android:id="#+id/btnCancle"
android:layout_width="0dp"
android:layout_height="40dip"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="#string/btn_cancle_email" />
</LinearLayout>
</RelativeLayout>
Yes, you can set soft input mode properties for activity in manifest, select application tab in manifest, select your activity, set property softInputMode to adjustPan|adjustResize.
or set directly in manifest.xml by inserting following line between tag
android:windowSoftInputMode="stateVisible|adjustResize|adjustPan"