0

これで、2 つの EditText フィールド (ユーザー名) と (パスワード) を持つログイン画面ができました。

私はこれをやった

<ScrollView  xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@android:color/white"
    android:fillViewport="true" android:layout_weight="1">

<LinearLayout
android:id="@+id/rootView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical">

    <ImageView
        android:id="@+id/logo"
        android:layout_width="280dp"
        android:layout_height="80dp"
        android:contentDescription="@string/app_name"
        android:src="@drawable/logo"/>

    <EditText
        android:id="@+id/username"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:hint="@string/email"
        android:inputType="textEmailAddress"
        android:singleLine="true">
    </EditText>

    <EditText
        android:id="@+id/password"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:hint="@string/password"
        android:inputType="textPassword"
        android:singleLine="true"/>

    <Button
        android:id="@+id/btnLogin"
        android:layout_width="130dp"
        android:layout_height="34dp"
        android:layout_marginTop="20dp"
        android:background="@drawable/login_button"
        android:onClick="onLoginClick"/>

    <TextView
        android:id="@+id/btnMoreInfo"
        android:layout_width="wrap_content"
        android:layout_height="34dp"
        android:clickable="true"
        android:layout_marginTop="20dp"
        android:text="@string/more_about"
        android:onClick="onMoreInfo"/>

私の問題は、ユーザー名をクリックすると、キーボードが android:id="@+id/btnMoreInfo" ボタンを非表示にすることです。android:windowSoftInputMode="adjustResize" をアクティビティ マニフェスト ファイルに追加しましたが、何も機能していません。これを行う方法の手がかりはありますか??

4

2 に答える 2

0

RelativeLayoutの代わりに使用しLinearLayout

     <TextView
            android:id="@+id/btnMoreInfo"
            ...
            android:layout_alignParentBottom="true"
      />

     <Button
            android:id="@+id/btnLogin"
            ...
            android:layout_above="@id/btnMoreInfo"
      />
于 2013-08-09T16:48:18.087 に答える
0

LinearLayout を作成しますandroid:layout_height="wrap_content"

于 2013-08-09T14:17:12.613 に答える