So basically i have a main layout which is a log in screen. The problem is that whole Relative-layout goes off the screen when i tap onto Edittext field...
Here is my xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/background_gradient"
android:theme="#android:style/Theme.NoTitleBar"
tools:context=".MainActivity" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/editText1"
android:layout_centerHorizontal="true"
android:layout_marginBottom="60dp"
android:baselineAlignBottom="true"
android:contentDescription="#string/skedo"
android:src="#drawable/logo" />
<EditText
android:id="#+id/editText1"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_above="#+id/editText2"
android:layout_centerHorizontal="true"
android:layout_marginLeft="13dp"
android:layout_marginRight="13dp"
android:drawableLeft="#drawable/user"
android:drawablePadding="13dp"
android:paddingLeft="13dp"
android:inputType="textEmailAddress"
android:background="#drawable/round_corners"
android:ems="10"
android:hint="#string/email" />
<EditText
android:id="#+id/editText2"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_centerInParent="true"
android:layout_marginLeft="13dp"
android:layout_marginRight="13dp"
android:layout_marginTop="8dp"
android:drawableLeft="#drawable/lock"
android:drawablePadding="13dp"
android:paddingLeft="13dp"
android:background="#drawable/round_corners"
android:ems="10"
android:hint="#string/password"
android:inputType="textPassword" >
</EditText>
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/editText2"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:textSize="17sp"
android:shadowColor="#000000"
android:shadowRadius="1"
android:shadowDx="0"
android:shadowDy="1"
android:text="#string/login"
android:textColor="#ffffff"
android:background="#drawable/button_states" />
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/button1"
android:layout_centerInParent="true"
android:layout_marginTop="23dp"
android:clickable="true"
android:text="#string/forgot_password"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="13sp" />
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView1"
android:layout_centerHorizontal="true"
android:layout_marginTop="23dp"
android:contentDescription="#string/imgdesc"
android:src="#drawable/or" />
<Button
android:id="#+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/imageView2"
android:shadowColor="#ffffff"
android:shadowRadius="1"
android:shadowDx="0"
android:textSize="14sp"
android:textStyle="bold"
android:shadowDy="1"
android:layout_centerHorizontal="true"
android:layout_marginTop="23dp"
android:text="#string/register"
android:background="#drawable/create_account"
/>
So when this happens my logo disappears off the screen and i would like it to be showing. The best example would be facebook log in screen, where when you tap on editText it squashes everything and logo is still visible. So how can i achieve such effect?
So when nothing is pressed:
http://postimage.org/image/swdtggnil/
When keyboard appears
http://postimage.org/image/5pbdfrftl/
I want it to behave exactly like that.
If I have not misunderstood you can add
android:windowSoftInputMode="adjustPan"
in the AndroidManifest.xml
<activity
android:name="yourActivity"
android:windowSoftInputMode="adjustPan" >
</activity>
Related
I've created a layout for a survey as a popup window, but somehow keyboard isn't shown when a focus is true, even after a tap to the edittext...
In other activities, all EditTexts work correctly.
Recently, I've changed app Theme to AppCompat to implement Material components. I am not sure it can impact, but no ideas from my side, why it doesn't work.
Any ideas?
<?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"
android:background="#66ccff"
android:gravity="center" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/imageSurveyClose"
android:layout_centerHorizontal="true"
android:paddingTop="40dp"
android:fontFamily="sans-serif"
android:gravity="center"
android:text="Question"
android:textColor="#ffffff"
android:textSize="22dp" />
<ImageButton
android:id="#+id/imageSurveyClose"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:src="#drawable/close"
android:background="#null" />
<Button
android:id="#+id/button1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="Send" />
<RadioGroup
android:id="#+id/radioGroup2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView1"
android:paddingTop="20dp"
android:layout_marginLeft="20dp"
>
<RadioButton
android:id="#+id/radio0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="v1"
android:layout_gravity="left"
android:fontFamily="sans-serif"
android:textSize="22dp"
android:buttonTint="#ffffff"
android:textColor="#ffffff"
android:layout_marginTop="10dp"
/>
<RadioButton
android:id="#+id/radio1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:fontFamily="sans-serif"
android:text="v2"
android:buttonTint="#ffffff"
android:layout_marginTop="12dp"
android:textColor="#ffffff"
android:textSize="22dp" />
<RadioButton
android:id="#+id/radio2"
android:layout_width="wrap_content"
android:buttonTint="#ffffff"
android:layout_height="wrap_content"
android:text="v3"
android:layout_gravity="left"
android:fontFamily="sans-serif"
android:layout_marginTop="12dp"
android:textSize="22dp"
android:textColor="#ffffff"
/>
</RadioGroup>
<EditText
android:id="#+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/radioGroup2"
android:layout_below="#+id/radioGroup2"
android:layout_marginTop="47dp"
android:ems="10" >
<requestFocus />
</EditText>
</RelativeLayout>
You can try removing the <requestFocus /> element in the EditText and see whether the keyboard appears. Afterwards you can request the focus programmatically inside the activity.
I have a button aligned to the bottom of my Relative Layout which I want to be pushed up when soft keypad is shown, but I don't want it to overlap other views, any hints?
I have the following layout(XML):
<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="#drawable/bg_app" >
<Spinner
android:id="#+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/Button01"
android:layout_centerHorizontal="true"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="02dp"
android:background="#drawable/options_bg" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_alignLeft="#+id/spinner1"
android:layout_below="#+id/textView6"
android:layout_marginTop="03dp"
android:scaleType="centerCrop" />
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/imageView1"
android:layout_below="#+id/spinner1"
android:layout_marginLeft="03dp"
android:layout_toRightOf="#+id/imageView1"
android:text="Date"
android:textColor="#002f44"
android:textSize="18sp" />
<Button
android:id="#+id/button2"
android:layout_width="170dp"
android:layout_height="30dp"
android:layout_alignLeft="#+id/textView1"
android:layout_alignRight="#+id/spinner1"
android:layout_below="#+id/textView1"
android:layout_marginTop="05dp"
android:background="#drawable/btn_calendar"
android:textColor="#FFBF00" />
<AutoCompleteTextView
android:id="#+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/imageView1"
android:layout_alignLeft="#+id/button2"
android:layout_alignRight="#+id/spinner1"
android:digits="abcdefghijklmnopwrstuvwxyzABCDEFGHIJKLMNOPWRSTUVWXYZ. "
android:ems="6"
android:hint="Enter Name"
android:inputType="textCapWords"
android:maxLength="25"
android:textColor="#002f44" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/editText1"
android:layout_below="#+id/editText1"
android:padding="03dp"
android:textColor="#610B0B" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:visibility="invisible" />
<Button
android:id="#+id/button1"
android:layout_width="120dp"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:background="#drawable/btn_addreminder"
android:text="Save"
android:textColor="#002f44"
android:textStyle="bold"
android:visibility="gone" />
<RadioGroup
android:id="#+id/radioGroup1"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="-5dp"
android:background="#drawable/widget_style"
android:orientation="horizontal"
android:visibility="gone" >
<RadioButton
android:id="#+id/radio0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="Self"
android:textColor="#002f44" />
<RadioButton
android:id="#+id/radio1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:text="Other"
android:textColor="#002f44" />
</RadioGroup>
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/button1"
android:layout_alignBottom="#+id/button1"
android:layout_alignRight="#+id/Button01"
android:text="Type "
android:textColor="#002f44"
android:textSize="18sp"
android:visibility="gone" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView4"
android:layout_below="#+id/radioGroup1"
android:layout_marginTop="25dp"
android:text="Name"
android:textColor="#002f44"
android:textSize="18sp"
android:visibility="gone" />
<AutoCompleteTextView
android:id="#+id/autoname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:digits="abcdefghijklmnopwrstuvwxyzABCDEFGHIJKLMNOPWRSTUVWXYZ. "
android:ellipsize="end"
android:ems="8"
android:hint="Friends Name"
android:maxLines="1"
android:scrollHorizontally="true"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#002f44"
android:visibility="gone" >
</AutoCompleteTextView>
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/spinner1"
android:layout_alignRight="#+id/spinner1"
android:layout_below="#+id/spinner1"
android:clickable="false"
android:lineSpacingExtra="2.3dp"
android:padding="10dp"
android:text="TextView"
android:textColor="#002f44"
android:textSize="14sp"
android:visibility="invisible" />
<Button
android:id="#+id/Button01"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="10dp"
android:layout_marginTop="05dp"
android:background="#drawable/btn_exit"
android:textStyle="bold" />
<Spinner
android:id="#+id/spinner2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/imageView1"
android:layout_alignRight="#+id/editText1"
android:layout_below="#+id/textView2"
android:layout_marginTop="03dp"
android:background="#drawable/drop_down" />
<Button
android:id="#+id/Button02"
android:layout_width="100dp"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="0dp"
android:layout_marginRight="20dp"
android:background="#drawable/btn_addreminder"
android:text="Next"
android:textColor="#002f44"
android:textStyle="bold" />
<Button
android:id="#+id/button4"
android:layout_width="100dp"
android:layout_height="40dp"
android:layout_alignBaseline="#+id/Button02"
android:layout_alignBottom="#+id/Button02"
android:layout_alignParentLeft="true"
android:layout_marginLeft="42dp"
android:background="#drawable/btn_addreminder"
android:text="Skip"
android:textColor="#002f44"
android:textStyle="bold" />
</RelativeLayout>
In the manifest:
android:windowSoftInputMode="stateHidden|adjustResize"
below is the picture:
The problem is that you use alignParentBottom=true for your button. Try to construct the layout without setting this parameter to true.
<Button
android:id="#+id/Button02"
android:layout_width="100dp"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="0dp"
android:layout_marginRight="20dp"
android:background="#drawable/btn_addreminder"
android:text="Next"
android:textColor="#002f44"
android:textStyle="bold" />
EDIT
As the documentation says:
adjustResize The activity's main window is always resized to make room for the soft keyboard on screen.
adjustPan The activity's main window is not resized to make room for the soft keyboard. Rather, the contents of the window are automatically panned so that the current focus is never obscured by the keyboard and users can always see what they are typing. This is generally less desirable than resizing, because the user may need to close the soft keyboard to get at and interact with obscured parts of the window.
I suggest you to rethink the design, and use adjustPan instead of adjustResize.
But if your next button is meant to be used to navigate through your edit texts than take a look at this
try to use this android:windowSoftInputMode="stateUnchanged|adjustResize"
When I enter text in the EditText in my emulator, the screen is not moving up so I cannot see what I am inputting.
I wanted to attach screenshots, but I don't have the required reputation yet.
This is a problem only with the following code.
<?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" >
<EditText
android:id="#+id/recQsEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_alignRight="#+id/textView1"
android:layout_below="#+id/textView1"
android:layout_marginTop="16dp"
android:ems="10"
android:maxLines="1"
android:padding="5dip"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" >
<requestFocus />
</EditText>
<EditText
android:id="#+id/recAnsEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView2"
android:layout_alignRight="#+id/recQsEditText"
android:layout_below="#+id/textView2"
android:layout_marginTop="18dp"
android:ems="10"
android:maxLines="1"
android:padding="5dip"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="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_marginTop="49dp"
android:text="#string/recoveryInfo"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/recQsEditText"
android:layout_below="#+id/recQsEditText"
android:layout_marginTop="73dp"
android:text="#string/recoveryAnsText"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Button
android:id="#+id/setRecQsBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/recAnsEditText"
android:layout_centerHorizontal="true"
android:layout_marginTop="48dp"
android:text="#string/saveChangesBtn" />
</RelativeLayout>
Meanwhile, it is working fine in another screen on the same app.
The working code is -
<?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" >
<EditText
android:id="#+id/addUserIdEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView1"
android:layout_marginLeft="30dp"
android:ems="10"
android:maxLines="1" />
<EditText
android:id="#+id/addTitleEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/TextView01"
android:layout_below="#+id/TextView01"
android:ems="10"
android:maxLines="1" >
<requestFocus />
</EditText>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/addUserIdEditText"
android:layout_below="#+id/addTitleEditText"
android:text="#string/userIdInputText"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/TextView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/addUserIdEditText"
android:layout_below="#+id/addUserIdEditText"
android:text="#string/passwordInputText"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_alignParentTop="true"
android:layout_marginTop="26dp"
android:text="#string/titleInputText"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/addPasswordEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/TextView02"
android:layout_alignRight="#+id/addUserIdEditText"
android:layout_below="#+id/TextView02"
android:ems="10"
android:inputType="textPassword"
android:maxLines="1" />
<TextView
android:id="#+id/TextView03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/addPasswordEditText"
android:layout_below="#+id/addPasswordEditText"
android:text="#string/loginURLinputText"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/addLoginUrlEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/TextView03"
android:layout_below="#+id/TextView03"
android:ems="10"
android:maxLines="1" />
<EditText
android:id="#+id/addOtherNotesEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView2"
android:layout_below="#+id/textView2"
android:ems="10"
android:maxLines="2" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/addLoginUrlEditText"
android:layout_below="#+id/addLoginUrlEditText"
android:text="#string/otherNotesInputText"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Button
android:id="#+id/saveButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/addOtherNotesEditText"
android:layout_marginTop="36dp"
android:layout_toRightOf="#+id/textView2"
android:onClick="saveOnClick"
android:text="#string/saveBtn" />
</RelativeLayout>
I'm struggling to figure out why it isn't working. Please help!
In your AndroidManifest file,
add
android:windowSoftInputMode="adjustPan"
to your activity class.
example:
<activity
android:name=".YourActivity"
android:label="#string/app_name"
android:windowSoftInputMode="adjustPan" />
This will bring editText properly adjusted to soft keyboard. check out other options in it to suit your needs.
I have a multiline Edittext. When user touch it to type it shows half of it. Soft Keyboard covers the rest. I need it to be viewed fully.
This is how it shows now.
I want it to look like this.
I have used both adjustPan & adjustResize for android:windowSoftInputMode but nothing changed.
This is my XML layout.
<RelativeLayout
android:id="#+id/base"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/bg_type"
android:keepScreenOn="true"
android:orientation="vertical" >
<ImageView
android:id="#+id/own"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="120dp"
android:layout_marginTop="160dp"
android:contentDescription="#string/image"
android:src="#drawable/own" />
<ImageView
android:id="#+id/a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/own"
android:layout_marginLeft="75dp"
android:layout_toRightOf="#+id/own"
android:contentDescription="#string/image"
android:src="#drawable/a_pressed" />
<ImageView
android:id="#+id/b"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/a"
android:layout_marginLeft="20dp"
android:layout_toRightOf="#+id/a"
android:contentDescription="#string/image"
android:src="#drawable/b" />
<ImageView
android:id="#+id/c"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/b"
android:layout_marginLeft="20dp"
android:layout_toRightOf="#+id/b"
android:contentDescription="#string/image"
android:src="#drawable/c" />
<FrameLayout
android:id="#+id/txtlayer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="160dp" >
<com.empite.telegramstop.Txt
android:id="#+id/txt"
style="#style/blue_edittext"
android:layout_width="820dp"
android:layout_height="200dp"
android:gravity="top"
android:imeOptions="actionNext"
android:inputType="textMultiLine"
android:nextFocusLeft="#id/txt"
android:nextFocusUp="#id/txt"
android:padding="10dp"
android:text="#string/msg_a"
android:textSize="25dp"
android:textStyle="bold"
android:typeface="monospace" >
<requestFocus />
</com.empite.telegramstop.Txt>
</FrameLayout>
<TextView
android:id="#+id/remain"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/c"
android:layout_centerVertical="false"
android:layout_marginRight="-15dp"
android:layout_marginTop="325dp"
android:gravity="center"
android:text="#string/remaining"
android:textColor="#color/remain"
android:textSize="40dp"
android:textStyle="bold"
android:visibility="visible" />
<ImageView
android:id="#+id/nxt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/remain"
android:layout_below="#+id/c"
android:layout_marginLeft="20dp"
android:layout_marginTop="148dp"
android:contentDescription="#string/image"
android:scaleType="center"
android:src="#drawable/bt_next" />
<RelativeLayout
android:id="#+id/RelativeLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/own"
android:layout_below="#+id/txtlayer"
android:layout_marginTop="290dp"
android:background="#drawable/panel_type_code" >
<EditText
android:id="#+id/no1"
android:layout_width="55dp"
android:layout_height="75dp"
android:layout_alignParentLeft="true"
android:layout_marginLeft="275dp"
android:layout_marginTop="18dp"
android:background="#null"
android:gravity="center"
android:imeOptions="actionDone"
android:inputType="number"
android:maxLines="1"
android:textSize="45dp"
android:textStyle="bold"
android:typeface="serif" />
<EditText
android:id="#+id/no2"
android:layout_width="55dp"
android:layout_height="75dp"
android:layout_alignBaseline="#+id/no1"
android:layout_alignBottom="#+id/no1"
android:layout_marginLeft="10dp"
android:layout_toRightOf="#+id/no1"
android:background="#null"
android:ems="10"
android:gravity="center"
android:imeOptions="actionDone"
android:inputType="number"
android:textSize="45dp"
android:textStyle="bold"
android:typeface="serif" />
<EditText
android:id="#+id/no3"
android:layout_width="55dp"
android:layout_height="75dp"
android:layout_alignBaseline="#+id/no2"
android:layout_alignBottom="#+id/no2"
android:layout_marginLeft="10dp"
android:layout_toRightOf="#+id/no2"
android:background="#null"
android:ems="10"
android:gravity="center"
android:imeOptions="actionDone"
android:inputType="number"
android:textSize="45dp"
android:textStyle="bold"
android:typeface="serif" />
<EditText
android:id="#+id/no4"
android:layout_width="55dp"
android:layout_height="75dp"
android:layout_alignBaseline="#+id/no3"
android:layout_alignBottom="#+id/no3"
android:layout_marginLeft="9dp"
android:layout_toRightOf="#+id/no3"
android:background="#null"
android:ems="10"
android:gravity="center"
android:imeOptions="actionDone"
android:inputType="number"
android:textSize="45dp"
android:textStyle="bold"
android:typeface="serif" />
<EditText
android:id="#+id/no5"
android:layout_width="55dp"
android:layout_height="75dp"
android:layout_alignBaseline="#+id/no4"
android:layout_alignBottom="#+id/no4"
android:layout_marginLeft="9dp"
android:layout_toRightOf="#+id/no4"
android:background="#null"
android:ems="10"
android:gravity="center"
android:imeOptions="actionDone"
android:inputType="number"
android:textSize="45dp"
android:textStyle="bold"
android:typeface="serif" />
<EditText
android:id="#+id/no6"
android:layout_width="55dp"
android:layout_height="75dp"
android:layout_alignBaseline="#+id/no5"
android:layout_alignBottom="#+id/no5"
android:layout_marginLeft="10dp"
android:layout_toRightOf="#+id/no5"
android:background="#null"
android:ems="10"
android:gravity="center"
android:imeOptions="actionDone"
android:inputType="number"
android:textSize="45dp"
android:textStyle="bold"
android:typeface="serif" />
</RelativeLayout>
<EditText
android:id="#+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#null"
android:ems="10"
android:visibility="visible" />
</RelativeLayout>
try this may be it is use full adjust manifest
<activity
android:windowSoftInputMode="adjustResize"
android:name=".youractivity" android:label="#string/app_name" >
and see this move up text view only when virtual keyboard open on android
use the EditText's setOnFocusChangeListener() method, and change the layout accordingly.
Try to add a ScrollView before your root RelativeLayout, and delete the android:windowSoftInputMode from your manifest.
I am currently having trouble with my GUI design because of the whole page will be shifted to the right and become like this:
create_events.xml
<?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"
android:background="#color/crimson"
android:orientation="vertical" >
<TextView
android:id="#+id/txtDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
<TextView
android:id="#android:id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/txtDate"
android:layout_below="#+id/txtDate"
android:layout_marginTop="16dp"
android:text="Title:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#android:id/text1"
android:layout_alignBottom="#android:id/text1"
android:layout_marginLeft="34dp"
android:layout_toRightOf="#android:id/text1" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#android:id/text1"
android:layout_below="#+id/spinner1"
android:layout_marginTop="18dp"
android:text="Location:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/spinner1"
android:layout_alignTop="#+id/textView2"
android:ems="10" >
<requestFocus />
</EditText>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView2"
android:layout_below="#+id/editText1"
android:layout_marginTop="15dp"
android:text="Start At:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView1"
android:layout_alignBottom="#+id/textView1"
android:layout_toRightOf="#+id/textView2"
android:ems="10"
android:inputType="time" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_below="#+id/editText2"
android:layout_marginTop="22dp"
android:text="End At:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/textView3"
android:layout_toRightOf="#+id/textView2"
android:ems="10"
android:inputType="time" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView3"
android:layout_below="#+id/editText3"
android:layout_marginTop="23dp"
android:text="Alarm:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Button
android:id="#+id/btnAlarm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView4"
android:layout_alignBottom="#+id/textView4"
android:layout_alignLeft="#+id/editText3"
android:text="Set Alarm" />
<Button
android:id="#+id/btnMain"
style="#style/main_menu"
android:layout_width="170dp"
android:layout_height="60dp"
android:layout_alignParentBottom="true"
android:layout_marginBottom="14dp"
android:layout_toRightOf="#+id/textView1"
android:background="#drawable/blue_load_picbutton"
android:text="Main Menu" />
<Button
android:id="#+id/btnEvent"
style="#style/main_menu"
android:layout_width="170dp"
android:layout_height="60dp"
android:layout_above="#+id/btnMain"
android:layout_alignLeft="#+id/btnMain"
android:layout_marginBottom="14dp"
android:background="#drawable/blue_load_picbutton"
android:text="Create Event" />
<TextView
android:id="#+id/txtName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignRight="#+id/editText1"
android:text="TextView" />
</RelativeLayout>
I do not know the reason as to why the whole screen is shifted. The last time I opened, it was fits in the screen perfectly. Anyone has any idea why, can you please help me? Thanks.
Edited:
After doing according to what #Andy Res said, My screen currently is displayed like this. For your reference, the skin that I am using for my emulator is WVGA854.
I see you allign your Title to the right of txtDate.
And then all the controls are aligned having the Title as a reference.
So I believe this line may cause the shifting to the right.
<TextView
android:id="#android:id/text1"
android:layout_alignRight="#+id/txtDate"
.... />
Try to remove: android:layout_alignRight="#+id/txtDate" and see if any effect.