1

我想在所选editText的下方显示对话框。我有一个edittext列表。当我单击其中一个编辑文本时,对话框将显示在该编辑文本的下方。我想在图片中尝试。这在android中可能吗?

我想试试这样。我为我的原始照片感到抱歉。

谢谢。

4

3 回答 3

2

试试lorensiuswlt开发的 NewQuickAction和NewQuickAction3D。这将在点击事件的位置显示 PopOver 对话框。试试这个,可能对你有帮助。

于 2013-05-02T10:27:16.343 回答
0

为此使用PopupWindow 。使用showAsDropDownshowAtLocation喜欢

 popupWindow.showAsDropDown(anchorView, 50, -30); 

请参阅使用 PopupWindow 的示例

于 2013-05-02T10:29:34.080 回答
0

创建对话框后,获取可用于设置 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();
于 2013-05-02T10:30:28.623 回答