ITeye博客

AlertDialog5种默认Theme对应的样式

dengzh · 2016-06-26 11:03 · android · android_提示框 · 移动开发 · AlertDialog · theme · 样式 · Markdown

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

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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。