开发者

setSoftInputMode for a Dialog to not hide EditText while typing?

开发者 https://www.devze.com 2023-03-21 14:42 出处:网络
I have a Custom Dialog that has an EditText at the bottom of the view. When I select the EditText, t开发者_运维百科he keyboard comes up but hides the EditText within the Dialog..

I have a Custom Dialog that has an EditText at the bottom of the view. When I select the EditText, t开发者_运维百科he keyboard comes up but hides the EditText within the Dialog..

I know that you can use windowSoftInputMode for an activity and the Reference says you can use Window.setSoftInputMode() for non activities.. But how to do this???

Reference

I tried doing this Getting Keyboard To Appear Without Having To Click on EditText

But after

Dialog.show();

i placed

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

But nothing works.. Help Thanks


Try this instead:

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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号