【发布时间】:2016-07-04 20:05:10
【问题描述】:
我使用 Builder 制作了 alertDialog 并为它分配了这样的布局:
View view2 = LayoutInflater.from(getContext()).inflate(R.layout.information_dialog_layout, null);
AlertDialog alertDialog = new AlertDialog.Builder(getContext(), R.style.ert).create();
alertDialog.setView(view2);
alertDialog.show();
但无法检索 px 中的对话框高度,也尝试了 'Rect' 类但没有帮助(虽然可能设置错误)...? P.S 我已经在 StackOverflow 上查找了类似问题的一些答案,但这些对我都不起作用:s
【问题讨论】:
-
实际上
view2.getMeasuredHeight()应该在显示对话框之后工作。 -
它没有 - 得到“0”:s
-
@SakchhamSharma 对于 U 使用 Builder 的示例,答案不存在
标签: java android xml height android-alertdialog