【发布时间】:2014-09-01 22:17:20
【问题描述】:
我想使用 xml 中的布局创建一个警报对话框。我试过这个:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
LayoutInflater inflater = getLayoutInflater();
View v = inflater.inflate(R.id.optionsmenu, null);
AlertDialog dialog = builder.setView(v).create();
dialog.show();
它不起作用。 optionsmenu 是我想用来创建警报对话框的布局。我可以将警报对话框视图设置为此内部布局吗?
here 是图片的网址。你可以看到我想要使用的布局。
【问题讨论】:
标签: android layout dialog android-alertdialog