2017-06-07 13 views
0

私は、ソフトキーボードが、それは以下のようなボタンを隠し来ると
enter image description hereカスタムダイアログでソフトキーボードの隠れボタンを防ぐ方法は?

を次のようなカスタムダイアログを持っています。

enter image description here

私のコード

https://mcaf.ee/9qhnef

どのボタンであることを非表示にするに提出避けるために?私はautoresizeとauto panを追加しましたが、これまでのところ運はありません。

+1

移動全景とscrollviewアンドロイドでこのプロパティを追加します。[非表示にする方法キーボードのisScrollContainer =「true」を –

+0

可能な重複ダイアログで[?](https://stackoverflow.com/questions/17362273/how-to-hide-keyboard-on-dialog-showing) –

答えて

0

属性全体を1つの線形レイアウトに追加し、スクロールビューに配置します。これがあなたを助けることを願っています

0

あなたはこの

dialog.getWindow()setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN)を試すことができます。

またはXMLにあなたはこの

アンドロイド変更することができますフォーカス可能=「true」を アンドロイド:focusableInTouchMode =「true」を

0

を私はとの対話フィードバックを実装するために持っていたとき、私もかつて同じ問題を持っていました画面の高さにほぼ一致する高さ。 ScrollViewをビューの親レイアウトにxmlファイルなどで追加する必要があります。

<ScrollView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    //your content View goes here 

    </ScroolView> 

、その後の断片でビューを膨張させた後、 があなたのonCreateViewでこれを試してみてください。マニフェストファイルに定義されたとき、それは活動の場合にはそうであるよう

getDialog().getWindow() 
.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); 

SOFT_INPUT_ADJUST_RESIZEは、トリックを行います。お役に立てれば。

0

あなたのリンクされたXMLを以下のxmlで更新してテストしました。

<?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:background="#1260C5" 
    android:orientation="vertical"> 

    <ScrollView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_weight="1" 
     android:alpha=".85"> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical"> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:alpha=".5" 
       android:gravity="center" 
       android:orientation="vertical"> 

       <ImageButton 
        android:id="@+id/imgNotificationClose" 
        android:layout_width="50dp" 
        android:layout_height="50dp" 
        android:background="#00000000" 
        android:scaleType="fitCenter" 
        android:src="@mipmap/ic_launcher" /> 

       <TextView 
        android:id="@+id/txtNotification" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:gravity="center" 
        android:text="CHANGE PASSWORD" 
        android:textAppearance="@style/TextAppearance.AppCompat.Large" 
        android:textSize="36sp" 
        android:visibility="gone" /> 

      </LinearLayout> 


      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="5dp" 
       android:gravity="top" 
       android:orientation="vertical"> 


       <TextView 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 

        android:layout_marginLeft="20dp" 
        android:layout_marginRight="20dp" 
        android:gravity="left|center" 
        android:text="Email" 
        android:textStyle="bold" /> 

       <EditText 
        android:id="@+id/old_email" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_marginBottom="15dp" 
        android:layout_marginLeft="20dp" 
        android:layout_marginRight="20dp" 
        android:background="#FFFFFF" 
        android:focusable="false" 
        android:padding="10dip" 
        android:paddingLeft="30dp" 
        android:paddingRight="30dp" 
        android:textColor="#000000" 
        android:textSize="14sp" /> 

       <TextView 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 

        android:layout_marginLeft="20dp" 
        android:layout_marginRight="20dp" 
        android:gravity="left|center" 
        android:text="Old Password" 
        android:textStyle="bold" /> 


       <EditText 
        android:id="@+id/password_change_edit_password_current_pass" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_marginBottom="15dp" 
        android:layout_marginLeft="20dp" 
        android:layout_marginRight="20dp" 
        android:background="#FFFFFF" 
        android:inputType="textPassword" 
        android:padding="10dip" 
        android:paddingLeft="30dp" 
        android:paddingRight="30dp" 
        android:textColor="#000000" 
        android:textSize="14sp" /> 

       <TextView 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 

        android:layout_marginLeft="20dp" 
        android:layout_marginRight="20dp" 
        android:gravity="left|center" 
        android:text="New Password" 
        android:textStyle="bold" /> 

       <EditText 
        android:id="@+id/password_change_edit_password_new_pass" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_marginBottom="15dp" 
        android:layout_marginLeft="20dp" 
        android:layout_marginRight="20dp" 
        android:background="#FFFFFF" 
        android:ems="10" 
        android:inputType="textPassword" 

        android:padding="10dip" 
        android:paddingLeft="30dp" 
        android:paddingRight="30dp" 
        android:textColor="#000000" 
        android:textSize="14sp" /> 

       <TextView 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 

        android:layout_marginLeft="20dp" 
        android:layout_marginRight="20dp" 
        android:gravity="left|center" 
        android:text="Confirm New Password" 
        android:textSize="14sp" 
        android:textStyle="bold" /> 

       <EditText 
        android:id="@+id/password_change_edit_password_confirm_pass" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_marginBottom="15dp" 
        android:layout_marginLeft="20dp" 
        android:layout_marginRight="20dp" 
        android:background="#FFFFFF" 
        android:ems="10" 
        android:inputType="textPassword" 

        android:padding="10dip" 
        android:paddingLeft="30dp" 
        android:paddingRight="30dp" 
        android:textColor="#000000" 
        android:textSize="14sp" /> 


       <LinearLayout 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_gravity="center_horizontal" 
        android:layout_marginTop="10dp" 
        android:orientation="horizontal"> 

        <ImageView 
         android:id="@+id/img_alert" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:src="@mipmap/ic_launcher" 
         android:visibility="invisible" /> 


        <TextView 
         android:id="@+id/password_change_validation_status" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:layout_gravity="center" 
         android:gravity="center" 
         android:text="" 
         android:textColor="#BEB2D1" 
         android:textSize="14sp" 
         android:textStyle="bold" /> 

       </LinearLayout> 

      </LinearLayout> 


     </LinearLayout> 
    </ScrollView> 

    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_weight="0"> 

     <Button 
      android:id="@+id/password_change_btn_password_submit" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginBottom="15dp" 
      android:layout_marginLeft="20dp" 
      android:layout_marginRight="20dp" 
      android:layout_marginTop="20dp" 
      android:paddingLeft="30dp" 
      android:paddingRight="30dp" 
      android:text="Submit" 
      android:textColor="#FFFFFF" 
      android:textSize="18sp" /> 

    </RelativeLayout> 

</LinearLayout> 
-1

私は同様の問題を抱えていたし、私はそれがフルスクリーンであったため、問題があったことが分かりました。あなたのstyles.xmlから(あなたがそれを持っている場合)これを削除しよう:scrollview内部

<item name="android:windowFullscreen">true</item> 
関連する問題