显示软键盘时,对话框上升 [英] Dialog goes up when softkeyboard is shown

查看:152
本文介绍了显示软键盘时,对话框上升的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个扩展到Dialog的类。在对话框中,我有EditText和ListView。当显示该对话框时,我的成功将软键盘向上。但是我的问题是,当显示软键盘时,我们可以让对话框不会上升吗?我试图在layout param中改变softInputMode来调整大小,但是它不起作用。我的对话框使用x和y位置,当软键盘显示和对话框上升时,我的对话框不在我想要的位置。

解决方案

尝试这样做:

  dialog.getWindow()。setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); 


I have a class that extend to Dialog. In that Dialog I have EditText and ListView. I success bring softkeyboard up when that dialog is shown. But my problem here is can we make dialog not goes up when softkeyboard is shown? I tried to change softInputMode in layout param to adjust resize but it's not working. My Dialog using x and y position, when softkeyboard shown and dialog goes up, my dialog not in position I want.

解决方案

Try to do this:

dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);

这篇关于显示软键盘时,对话框上升的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆