2017-03-10 12 views
0

私は3つのEditTextsを持つフラグメントを持っています。キーボードが画面のフォーカスをブロックする

EditTextをクリックすると、すべてのEditTextを表示する必要があります。つまり、EditText 1をクリックすると、EditText 3が表示されます。したがって、基本的には、すべてのEditTextを常に表示する必要があります。私はのEditTextフラグメントをクリックして今

は、ビットをシフトし、まだブロックのEditText数3

は、これは私のコードです:

<?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:layout_marginTop="10dp" 
android:layout_weight="6" 
android:orientation="horizontal"> 

<View 
    android:layout_width="0dp" 
    android:layout_height="wrap_content" 
    android:layout_weight="1" /> 

<LinearLayout 
    android:layout_width="0dp" 
    android:layout_height="wrap_content" 
    android:layout_weight="4" 
    android:orientation="vertical"> 

    <EditText 
     android:id="@+id/et_username" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="@drawable/apptheme_textfield_white_holo_no_borders_light" 
     android:gravity="center" 
     android:hint="@string/username_tag" 
     android:imeOptions="flagNoExtractUi|actionNext" 
     android:inputType="text" 
     android:maxLines="1" 
     android:textColor="@android:color/white" 
     android:textColorHint="@color/gray_lighter" 
     android:textCursorDrawable="@null" /> 

    <EditText 
     android:id="@+id/et_email" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
      android:background="@drawable/apptheme_textfield_white_holo_no_borders_light" 
     android:drawablePadding="5dp" 
     android:drawableStart="@drawable/profile_pressed" 
     android:gravity="center" 
     android:hint="@string/email_tag" 
     android:imeOptions="flagNoExtractUi|actionNext" 
     android:inputType="textEmailAddress" 
     android:maxLines="1" 
     android:textColor="@android:color/white" 
     android:textColorHint="@color/gray_lighter" 
     android:textCursorDrawable="@null" /> 

    <EditText 
     android:id="@+id/et_password" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="@drawable/apptheme_textfield_white_holo_no_borders_light" 
     android:drawablePadding="5dp" 
     android:drawableStart="@drawable/padlock" 
     android:gravity="center" 
     android:hint="@string/password" 
     android:imeOptions="flagNoExtractUi|actionDone" 
     android:inputType="textPassword" 
     android:maxLines="1" 
     android:textColor="@android:color/white" 
     android:textColorHint="@color/gray_lighter" 
     android:textCursorDrawable="@null" /> 

</LinearLayout> 

<View 
    android:layout_width="0dp" 
    android:layout_height="wrap_content" 
    android:layout_weight="1" /> 

</LinearLayout> 

私はマニフェストにadjustPanとadjustResizeをいじってみました両方とも機能しません。パスワード入力でのEditText 3は、キーボードによってブロックされていることを

enter image description here

注:

この

はイメージです。

+0

であなたのレイアウトを入れて内部の垂直指向のリニアレイアウトを挿入してくださいscrollview –

答えて

0

は、あなたがあなたの活動を宣言どこタグであなたのマニフェストに次のプロパティを追加します -

windowSoftInputMode="adjustResize" 

をし、スクロールビュー

+0

私は、全体のビューが断片になっていることを忘れていました。 – hyrulelink16