简体   繁体   English

当键盘可见时,Android Dialogue Fragment 不会向上移动

[英]Android Dialogue Fragment not moving up when keyboard is visible

I have implemented a custom dialogue fragment which contains a custom view pager and an edittext.View pager contains a grid.我已经实现了一个自定义对话片段,其中包含一个自定义视图寻呼机和一个 edittext.View 寻呼机包含一个网格。 To move the view upwards when keyboard is visible I have placed the view inside a scrollview.为了在键盘可见时向上移动视图,我将视图放置在滚动视图中。 When app is running view pager is not displaying.当应用程序运行时,视图寻呼机不显示。 How can I make this custom fragment scrollable when keypad is visible.当键盘可见时,如何使此自定义片段可滚动。 Please help me.请帮我。 Thanks in advance.提前致谢。

android:windowSoftInputMode="adjustPan"添加到应用程序清单文件中的相应活动标记。

In my case I tried everything, however the problem was not in the implementation of the dialog, or how the keyboard was invoked.就我而言,我尝试了所有方法,但问题不在于对话框的实现,也不在于如何调用键盘。 I was using a theme to make the status bar translucent and that caused the wrong behavior, by changing to another theme the dialog goes up without problems when invoking the keyboard.我正在使用一个主题使状态栏半透明并导致错误的行为,通过更改为另一个主题,对话框在调用键盘时没有问题。 I hope my answer is helpful希望我的回答有帮助

I was using this style我正在使用这种风格

 <style name="TranslucentTheme" parent="MyTheme">
    <item name="android:windowTranslucentStatus">true</item>
    <item name="android:windowDrawsSystemBarBackgrounds">true</item>
    <item name="android:statusBarColor">@android:color/transparent</item>
    <item name="android:fitsSystemWindows">true</item>
  </style>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM