Android 安卓,注册按钮向上移动
我对android和它的布局很陌生。我设计了注册屏幕,但它有一个问题。问题是当我启动数据输入注册按钮时,它会随着键盘向上移动并覆盖密码字段,它应该保持原样。 我怎样才能修好它? 下面是我的XML代码Android 安卓,注册按钮向上移动,android,android-layout,Android,Android Layout,我对android和它的布局很陌生。我设计了注册屏幕,但它有一个问题。问题是当我启动数据输入注册按钮时,它会随着键盘向上移动并覆盖密码字段,它应该保持原样。 我怎样才能修好它? 下面是我的XML代码 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match
<?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="@android:color/white"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/headerLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="40dp"
android:orientation="horizontal" >
<TextView
android:id="@+id/headerText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#ffffff"
android:text="SIGN UP"
android:textColor="#00aeef"
android:textSize="22dp" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:orientation="vertical" >
<EditText
android:id="@+id/fname"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="5dp"
android:background="@drawable/edit_text_design"
android:ems="10"
android:hint="First Name"
android:inputType="textCapSentences">
<requestFocus />
</EditText>
<EditText
android:id="@+id/lname"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:background="@drawable/edit_text_design"
android:ems="10"
android:hint="Last Name"
android:inputType="textCapSentences"/>
<EditText
android:id="@+id/eemail"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:background="@drawable/edit_text_design"
android:ems="10"
android:hint="Email"
android:inputType="textEmailAddress" >
</EditText>
<EditText
android:id="@+id/pass"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:background="@drawable/edit_text_design"
android:ems="10"
android:hint="Password"
android:inputType="textPassword" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp"
android:layout_alignParentBottom="true">
<Button
android:id="@+id/signupBtn"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:background="#ffffff"
android:text="SIGN UP"
android:textColor="#00aeef"
android:textSize="36dp" />
</LinearLayout>
</RelativeLayout>
谢谢尝试更改清单中活动的
android:WindowsofInputMode=“adjustNothing”
例:
如果不起作用,请尝试为windowSoftInputMode
使用不同的值
<activity
android:windowSoftInputMode="adjustNothing"
android:name=".SongPlayActivity"
android:label="@string/title_activity_song_play" >
</activity>