1.修改主界面背景颜色

转自http://www.dewen.io/q/9466

在AndroidMenifest.xml application 属性设置时不使用系统的
android:theme="@android:style/Theme.Holo", 而是自定义的           android:theme="@style/customtitlebar"
在values 中style.xml添加属性


<style name="customtitlebar" parent="android:Theme.Holo.Light">
        <item name="android:actionBarStyle"> @style/MyActionBar</item>
    </style>


    <style name="MyActionBar" parent="@android:style/Widget.Holo.ActionBar">
        <item name="android:titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>
    </style>


    <style name="MyTheme.ActionBar.TitleTextStyle" parent="android:style/TextAppearance.Holo.Widget.ActionBar.Title">
        <item name="android:textColor">@color/white</item>
    </style>
然后在color.xml中添加white属性值, 
    <color name="white">#ffffffff</color>
即可,以上是我修改4.0设置所得。


2.Theme.LightTheme.Dark的区别

http://blog.csdn.net/zmyde2010/article/details/7250962

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐