Android 打开键盘时调整对话框窗口

Android 打开键盘时调整对话框窗口,android,dialog,keyboard,Android,Dialog,Keyboard,我在用户自定义对话框和对话框视图中将linearLayout导航到底部,打开对话框后,linearLayout底部包含一些按钮,单击一个按钮时,我需要打开键盘并显示键盘顶部的linearLayout。如何做到这一点。在这里,我为对话框添加了样式 <style name="PopupDialogTheme" parent="@android:style/Theme.Dialog"> <item name="a

我在用户自定义对话框和对话框视图中将linearLayout导航到底部,打开对话框后,linearLayout底部包含一些按钮,单击一个按钮时,我需要打开键盘并显示键盘顶部的linearLayout。如何做到这一点。在这里,我为对话框添加了样式

   <style name="PopupDialogTheme" parent="@android:style/Theme.Dialog">
        <item name="android:windowBackground">@null</item>
        <item name="android:windowFrame">@null</item>
        <item name="android:windowIsFloating">true</item>
        <item name="android:backgroundDimEnabled">false</item>
        <item name="android:windowCloseOnTouchOutside">true</item>
        <!--<item name="android:windowTitleStyle">@style/DialogTheme</item>-->
    </style>
和showDialog方法的使用

this.getWindow().getDecorView().setSystemUiVisibility(activity.getWindow().getDecorView().getSystemUiVisibility());

           
this.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);

this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

WindowManager.LayoutParams params = this.getWindow().getAttributes();
params.gravity = Gravity.CENTER;
this.getWindow().setAttributes(params);
如果你有任何想法,请分享你的知识

WindowManager.LayoutParams dialogParams = this.getWindow().getAttributes();
dialogParams.width = windowWidth;
dialogParams.height = windowHeight;
dialogParams.gravity = Gravity.CENTER;
this.getWindow().setAttributes(dialogParams);
this.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
this.getWindow().getDecorView().setSystemUiVisibility(activity.getWindow().getDecorView().getSystemUiVisibility());

           
this.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);

this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

WindowManager.LayoutParams params = this.getWindow().getAttributes();
params.gravity = Gravity.CENTER;
this.getWindow().setAttributes(params);