当前位置: 移动技术网 > 移动技术>移动开发>Android > Android--style

Android--style

2020年09月01日  | 移动技术网移动技术  | 我要评论
Android–style<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/color

Android–style

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

这一段代码是创建新项目时编译器自动帮我们填好的,是一种主题,之前我们使用的ActionBar就是因为使用了这种主题才出现的,这段代码在res/values/styles.xml文件里面,其中

parent="Theme.AppCompat.Light.DarkActionBar"

可以改变界面的主题颜色,还有另两种Theme.AppCompat.NoActionBar 和Theme.AppCompat.Light.NoActionBar参数可选,这两种参数都是不带ActionBar的。

而style中的各个参数控制的地方可参考下图

本文地址:https://blog.csdn.net/chen_ru_tao/article/details/108566480

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网