2016-08-15 10 views
0

アプリ内の他の場所にダイアログが表示されています(keyboadはビューを非表示にしません)。この特別なダイアログでは、キーボードがオンのときに表示します。私は私のマニフェストでソフトキーボードがオンのときにDialogFragmentが表示されない

android:windowSoftInputMode="adjustPan" > 

セットを持って

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:custom="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/MyLayout" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_gravity="center" 
    android:layout_margin="15dp" 
    android:background="@drawable/dialog_background" 
    android:clickable="true" 
    android:orientation="vertical" 
    custom:maxHeight="@dimen/dialog_max_height" 
    custom:maxWidth="@dimen/dialog_max_width" > 

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginTop="20dp" 
     android:layout_marginBottom="10dp" 
     android:gravity="center" 
     android:text="something" /> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1" 
     android:orientation="vertical" > 

     <EditText 
      android:id="@+id/SomeEditText" 
      android:layout_width="match_parent" 
      android:layout_height="fill_parent" 
      android:minHeight="100dp" 
      android:layout_margin="15dp" 
      android:background="#ffffff" 
      android:gravity="right|top" 
      android:inputType="textMultiLine" 
      android:singleLine="false" 
      android:textColor="@color/edit_text_text_color" 
      android:textSize="16dp" /> 

    </LinearLayout> 

    <Button 
     android:id="@+id/SomeButton" 
     android:layout_width="match_parent" 
     android:layout_height="@dimen/dialog_button_height" 
     android:layout_margin="15dp" 
     android:text="text" /> 

</LinearLayout> 

:私はなぜ..

私のダイアログのレイアウトを把握することはできません。

私は置く:ソリューションが見つかり

+0

には、マニフェストファイルを表示します。 –

+0

私は 'android:windowSoftInputMode =" adjustPan "を持っています。しかし、それはアプリケーションの他のダイアログでうまく動作するので、私はそれがそれとは関係がないと考えました。私もadjustResizeを試みましたが、それは助けになりませんでした。 – BVtp

+0

このプロパティを試してください。マニフェストのあなたのアクティビティで、アンドロイド:windowSoftInputMode = "adjustResize"を –

答えて

1

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

をonCreateDialogコールバック

関連する問題