我想在所选editText的下方显示对话框。我有一个edittext列表。当我单击其中一个编辑文本时,对话框将显示在该编辑文本的下方。我想在图片中尝试。这在android中可能吗?
谢谢。
我想在所选editText的下方显示对话框。我有一个edittext列表。当我单击其中一个编辑文本时,对话框将显示在该编辑文本的下方。我想在图片中尝试。这在android中可能吗?
谢谢。
试试lorensiuswlt开发的 NewQuickAction和NewQuickAction3D。这将在点击事件的位置显示 PopOver 对话框。试试这个,可能对你有帮助。
为此使用PopupWindow 。使用showAsDropDown
或 showAtLocation
喜欢
popupWindow.showAsDropDown(anchorView, 50, -30);
创建对话框后,获取可用于设置 x 和 y 坐标的 LayoutParams 对象。这适用于任何风格的 Android。
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);
AlertDialog myDialog = dialogBuilder.create();
WindowManager.LayoutParams layoutParams = myDialog.getWindow().getAttributes();
layoutParams.gravity = Gravity.TOP | Gravity.LEFT;
layoutParams.x = 50;
layoutParams.y = 200;
myDialog.show();