[英]Why does Android AlertDialog go full screen?
如果將空數組傳遞給setItems
,我的AlertDialog
將在運行Android 9的仿真器上全屏顯示。但是,在運行Android 5.1的設備上,它不會全屏顯示,這是我試圖實現的行為。
是什么導致AlertDialog
在運行Android 9的模擬器上全屏顯示,而不在運行Android 5.1的設備上全屏顯示?
這就是我設置AlertDialog
:
AlertDialog.Builder builder = new AlertDialog.Builder(ContextActivity);
builder.setTitle(dialogTitel);
builder.setItems(arrayItems, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialogInterface, int item) {
...
}
});
final AlertDialog Block = builder.create();
Block.show();
它在模擬器上:
編輯:這在運行Android 5.1的設備上看起來如何。
根據需要使用以下設置寬度和高度
Block.Show().Window.SetLayout(some_width,some_height);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.