使用以下方法创建AlertDialog时遇到问题:
AlertDialog.Builder alertDialog = new AlertDialog.Builder(this)
.setTitle(R.string.deletion_title)
.setMessage(R.string.options_deleteExternalConfirm)
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Utils.deleteExternalDir();
dialog.cancel();
}
})
.setNegativeButton(R.string.no, null);
alertDialog.show();
尽管该对话框在大多数设备上看起来都不错,但在其他设备上(即带有Android 5.0.1的Galaxy S4-GT-I9505)却存在布局问题,请参见所附图片:。是什么原因造成的,我该如何解决?
(除了在自定义对话框中添加填充内容外,Build.PRODUCT.equals("GT-I9505")
因为那里可能存在同样问题但我不知道的电话)
原来这是android:fitsSystemWindows和Android Lollipop的问题,如此答案所示。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句