【发布时间】:2015-08-11 23:19:14
【问题描述】:
我有一个非常标准的 Dialog 调用。问题是它会打开状态栏,当他们单击“确定”时我会隐藏它。您知道如何防止显示对话框时出现状态栏吗?
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
// 2. Chain together various setter methods to set the dialog characteristics
builder.setMessage("Please fill in the missing blocks in this layout with photos or choose a different layout.")
.setTitle("Missing Photos");
// Add the buttons
builder.setPositiveButton("OK", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int id)
{
hideSystemUI();
}
});
// 3. Get the AlertDialog from create()
AlertDialog dialog = builder.create();
dialog.show();
【问题讨论】:
-
当对话框显示时你能用 dialog.setOnShowListener(...) 调用 hideSystemUI() 吗?
-
我试过了,状态栏还是出现了。
标签: java android android-alertdialog statusbar