だから基本的に私はログイン画面であるメインレイアウトを持っています。問題は、Edittextフィールドをタップすると、Relative-layout全体が画面から消えることです...
これが私の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"
/>
したがって、これが発生すると、私のロゴが画面から消えて表示されます。最良の例は、Facebookのログイン画面です。editTextをタップすると、すべてが押しつぶされ、ロゴは引き続き表示されます。では、どうすればそのような効果を達成できますか?
したがって、何も押されていない場合:http: //postimage.org/image/swdtggnil/
キーボードが表示されたら http://postimage.org/image/5pbdfrftl/
私はそれがまさにそのように振る舞うことを望みます。