AlertDialog5种默认Theme对应的样式

 

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

以上两种见下图,分别为深色/浅色

 

AlertDialog5种默认Theme对应的样式_第1张图片

 

 

AlertDialog.THEME_DEVICE_DEFAULT_DARK

AlertDialog.THEME_DEVICE_DEFAULT_LIGHT

以上两种见下图,分别为深色/浅色

AlertDialog5种默认Theme对应的样式_第2张图片

 

你可能感兴趣的:(android,android_提示框)