Android alertDialog textsize via Style files



我尝试通过主题更改alertDialog的textSize.xml但我可以做到。这是我从清单中的代码:

<application
    android:allowBackup="true"
    android:icon="@drawable/appicon"
    android:label="@string/app_name"
    android:theme="@style/CustomActionBarTheme">

我的主题.xml:

<style name="CustomActionBarTheme"
       parent="@android:style/Theme.Holo.Light.DarkActionBar">
    <item name="android:actionBarStyle">@style/CustomBar</item>
    <item name="android:actionBarTabTextStyle">@style/Widget.CustomTabText</item> 
    <item name="android:actionMenuTextAppearance">@style/CustomBar.MenuTextStyle</item>    
    <item name="android:alertDialogStyle">@style/CustomDialogTheme</item>   
</style>

<style name="CustomDialogTheme" parent="@android:style/Theme.Dialog">
    <item name="android:bottomBright">@color/white</item>
    <item name="android:bottomDark">@color/white</item>
    <item name="android:bottomMedium">@color/white</item>
    <item name="android:centerBright">@color/white</item>
    <item name="android:centerDark">@color/white</item>
    <item name="android:centerMedium">@color/white</item>
    <item name="android:fullBright">@color/blueDialog</item>
    <item name="android:fullDark">@color/blueDialog</item>
    <item name="android:topBright">@color/blueDialog</item>
    <item name="android:topDark">@color/blueDialog</item>
    <item name="android:textSize">50sp</item>
</style>    

提前谢谢!!

我可以自己回答:

<application
    android:allowBackup="true"
    android:icon="@drawable/varmasinfondo"
    android:label="@string/app_name"
    android:theme="@style/CustomerAppBaseTheme"
    >
<style name="CustomerAppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">    
    <item name="android:alertDialogTheme">@style/CustomerAlertDialogTheme</item>
    <item name="android:alertDialogStyle">@style/CustomerAlertDialogStyle</item>                
    <item name="android:actionBarStyle">@style/CustomBar</item>
    <item name="android:actionBarTabTextStyle">@style/Widget.CustomTabText</item> 
    <item name="android:actionMenuTextAppearance">@style/CustomBar.MenuTextStyle</item>    
</style>
<style name="CustomerAlertDialogTheme">...
</style>
<style name="CustomerAlertDialogStyle">...
</style>

...

然后,您可以更改样式 动作栏 和 警报对话框.

相关内容

  • 没有找到相关文章

最新更新