AlertDialog5种默认Theme对应的样式
程序员文章站
2022-04-20 16:38:01
...
Dialog alertDialog = new AlertDialog.Builder(this,AlertDialog.THEME_TRADITIONAL) .setTitle(R.string.msg_dialog_title) .setPositiveButton("确定", null) .setNegativeButton("取消", null) .setItems(list.toArray(new String[list.size()]), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { et.setText(list.get(which)); et.setSelection(et.getText().length()); } }).create(); alertDialog.show();
Builder(this,AlertDialog.THEME_TRADITIONAL)中第二个参数可以设置不同的Theme
AlertDialog.THEME_HOLO_DARK
AlertDialog.THEME_HOLO_LIGHT
以上两种见下图,分别为深色/浅色
AlertDialog.THEME_DEVICE_DEFAULT_DARK
AlertDialog.THEME_DEVICE_DEFAULT_LIGHT
以上两种见下图,分别为深色/浅色
上一篇: 治疗妇科病,艾灸会阴穴