GingerBread和ICS / JB的不同AlertDialog图标

时间:2013-07-21 03:36:20

标签: android themes alertdialog android-alertdialog android-theme

我正在使用ABS自定义主题。对于下面显示的AlertDialog,我使用的图标来自holo_light包。如您所见,对于GingerBread,对话框的背景颜色为黑色,因此对于GB,我需要使用holo_dark图标。那么,我该如何修复它以便当GB的黑色对话框出现时,它使用的图标来自holo_dark包,而对于HoneyComb的更轻的对话框,它使用holo_light图标?

或者可以这样做,使GB对话框的背景颜色变得像ICS或JB中那样亮?

JellyBean AlertDialog:

enter image description here

<小时/> GingerBread AlertDialog:

enter image description here

<小时/> 编辑:或者有没有办法将GB的黑色对话框更改为白色?

1 个答案:

答案 0 :(得分:1)

您可以在运行时获取当前的Android版本,如下所示:

if (Build.VERSION.SDK_INT >= 0x00000009 /*Build.VERSION_CODES.GINGERBREAD*/){...}

然后你可以根据它选择主题。