Android 当我将弹出窗口设置为外部可触摸时,错误编辑文本不会在弹出窗口中显示键盘
我的活动有一个弹出窗口,弹出窗口有编辑文本。问题是,当我将弹出窗口设置为外部可触摸时,错误编辑文本不会在android中打开弹出窗口中的键盘,我通过在弹出窗口中提供取消按钮来关闭弹出窗口。请帮忙,谢谢Android 当我将弹出窗口设置为外部可触摸时,错误编辑文本不会在弹出窗口中显示键盘,android,android-popupwindow,Android,Android Popupwindow,我的活动有一个弹出窗口,弹出窗口有编辑文本。问题是,当我将弹出窗口设置为外部可触摸时,错误编辑文本不会在android中打开弹出窗口中的键盘,我通过在弹出窗口中提供取消按钮来关闭弹出窗口。请帮忙,谢谢 LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE); final View popupView = inflate
LayoutInflater inflater = (LayoutInflater)
getSystemService(LAYOUT_INFLATER_SERVICE);
final View popupView = inflater.inflate(R.layout.repeat, null);
int width = LinearLayout.LayoutParams.MATCH_PARENT;
int height = LinearLayout.LayoutParams.WRAP_CONTENT;
boolean focusable = false;
final PopupWindow popupWindow = new PopupWindow(popupView, width, height, focusable);
// show the popup window
// which view you pass in doesn't matter, it is only used for the window tolken
popupWindow.showAtLocation(view, Gravity.CENTER, 0, 0);
final LinearLayout until = popupView.findViewById(R.id.Until);
Button pop_done = popupView.findViewById(R.id.pop_done);
Button pop_cancel = popupView.findViewById(R.id.pop_cancel);
dropdown = popupView.findViewById(R.id.spinner);
final EditText repetition = popupView.findViewById(R.id.repeat_times);
- 试试这个
LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE); final View popupView = inflater.inflate(R.layout.repeat, null); int width = LinearLayout.LayoutParams.MATCH_PARENT; int height = LinearLayout.LayoutParams.WRAP_CONTENT; final PopupWindow popupWindow = new PopupWindow(popupView, width, height); popupWindow.setFocusable(true); popupWindow.update(); // show the popup window // which view you pass in doesn't matter, it is only used for the window tolken popupWindow.showAtLocation(v, Gravity.CENTER, 0, 0); popupWindow.setOutsideTouchable(false); final LinearLayout until = popupView.findViewById(R.id.Until); Button pop_done = popupView.findViewById(R.id.pop_done); Button pop_cancel = popupView.findViewById(R.id.pop_cancel); Spinner dropdown = popupView.findViewById(R.id.spinner); final EditText repetition = popupView.findViewById(R.id.repeat_times);