1、AlertDialog
使用流程:setTitle(), setMessage(), create(), show()。
builder.show()等价于AlertDialog dialog = builder.create(); dialog.show();
两种方式:设置builder或直接设置Dialog
2、自定义对话框
设置布局、设置Style、自定义Dialog、显示
想要对话框没有白色背景,可以在Style中设置背景为透明。
使用流程:setTitle(), setMessage(), create(), show()。
builder.show()等价于AlertDialog dialog = builder.create(); dialog.show();
两种方式:设置builder或直接设置Dialog
设置布局、设置Style、自定义Dialog、显示
想要对话框没有白色背景,可以在Style中设置背景为透明。
相关文章: