-
Notifications
You must be signed in to change notification settings - Fork 278
Note when custom dialog themes
Logan Guo edited this page Jan 2, 2016
·
2 revisions
- Beware of the
theme
andstyle
when apply theme attribute. this is correct<item name="android:alertDialogTheme">@style/DialogTheme</item>
- Distinct and support at least two themes for pre-L and post-L devices
- If you want to apply to your AlertDialog a theme different than the one specified in your Activity’s theme, you can use a ContextThemeWrapper around your current context:
ContextThemeWrapper ctw = new ContextThemeWrapper(this, R.style.DialogTheme);
final AlertDialog.Builder builder = new AlertDialog.Builder(ctw);