我想在我的应用程序中设置所有AlertDialog的样式,并且正在使用android.support.v7.app.AlertDialog。这是我自定义的主题。
<resources>
<!-- Application theme. -->
<style name="AppTheme" parent="XXXXX">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
<item name="colorPrimary">@color/white</item>
<item name="colorPrimaryDark">@color/grey</item>
<item name="colorAccent">@color/blue</item>
<item name="android:alertDialogTheme">@style/AppTheme.DialogFragment</item>
<item name="alertDialogTheme">@style/AppTheme.DialogFragment</item>
</style>
<style name="AppTheme.DialogFragment" parent="XXXXX">
<item name="dialogCornerRadius">8dp</item>
<item name="android:windowTitleStyle">@style/AlertDialogTitle</item>
<item name="android:textAllCaps">false</item>
</style>
<style name="AlertDialogTitle" parent="Base.DialogWindowTitle.AppCompat">
<item name="android:textStyle">bold</item>
<item name="android:textColor">@color/red</item>
</style>
</resources>
在这里,我同时保留了android.app.AlertDialog和android.support.v7.app.AlertDialog进行比较。我只想更改alertDialog的标题。但是,在应用定义的AlertDialogTitle之后,只有android.app.AlertDialog更改了,我应该如何在xml中更改android.support.v7.app.AlertDialog?