I have a Popup which holds a couple of EditTexts in a ScrollView.
When i click on an EditText it scrolls up the View in background, not the Popup, therefore the keyboard blocks the EditText.
Any ideas ?
PopupWindow popUp = new PopupWindow(this);
popUp.update(0, 0, display.getWidth(), display.getHeight());
popUp.setFocusable(true);
LinearLayout llh = new LinearLayout(this)
llh.setOrientation(LinearLayout.HORIZONTAL);
ScrollView sv = new ScrollView(this);
EditText e1,e2,e3...
llh.addView(e1);
llh.addView(e2);
llh.addView(e3);
...
sv.addView(llh);
popUp.setContentView(llh);
popUp.showAtLocation(llh, Gravity.BOTTOM, 0, 0);
This is “launched” from a View which holds a ScrollView aswell.
If there is a workaround for this, it would be great.
I have faced the same problem as you, and to solve it, i created a custom
Dialogand with a custom theme (R.style.ThemeDialogCustomin the following example). I also setdialog.requestWindowFeature(Window.FEATURE_NO_TITLE)anddialog.setCanceledOnTouchOutside(true);and i set a custom layout withsetContentView. Something like this:In other words, the above piece of code tries to immitate the behavior of a
PopupWindow.EDIT For clarification purposes, if you need to access a view that was defined in the dialog’s custom layout, you can access it like this:
Hope that helps.