没有分隔符的对话框

时间:2014-04-18 22:19:05

标签: java android xml android-layout android-alertdialog

我正在尝试制作如下面屏幕截图所示的对话框。有谁知道怎么做?

enter image description here

3 个答案:

答案 0 :(得分:0)

您应该为对话框定义自定义布局并对其进行充气,与活动相同。 Here你可以找到一个很好的例子。

答案 1 :(得分:0)

在DialogFragment的onCreateView()中添加:

     getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);

答案 2 :(得分:0)

您可以使用常规AlertDialog.Builder。创建要显示的布局,对其进行膨胀,然后在构建器对象上调用setView()。在您的活动中:

LayoutInflater inflater = LayoutInflater.from(this);
View view = inflater.inflate(R.layout.your_dialog_layout);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setView(view).show();
相关问题