我只是按照这个http://www.laurivan.com/make-dialogs-obey-your-material-theme/的步骤来设置我的AlertDialog以符合Material Design风格。然而,我发现我仍然无法像这个网站那样进行设置,以下是我的代码和截图:
values-v14/styles.xml:
<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
</style>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowActionBarOverlay">true</item>
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">@color/colorPrimary</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="android:dialogTheme">@style/MyDialogTheme</item>
<item name="android:alertDialogTheme">@style/MyDialogTheme</item>
</style>
<style name="MyDialogTheme" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="android:windowBackground">@color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowCloseOnTouchOutside">false</item>
</style>
values/color.xml
<resources>
<color name="colorPrimaryDark">#3367d6</color>
<color name="colorPrimary">#4285f4</color>
<color name="windowBackgroundColor">#eeeeee</color>
<color name = "transparent">#0000</color>
</resources>
截图:
我想要移除分隔符,使按钮呈现右侧内边距样式,谢谢!