Android的L提单主题颜色错误 [英] Android L Change Theme Colors Error
本文介绍了Android的L提单主题颜色错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在下面为Android L时新的步伐在这里: HTTP: //developer.android.com/$p$pview/material/theme.html 我一直在试图更改状态栏的颜色,但它不能正常工作。
我的styles.xml:
< XML版本=1.0编码=UTF-8&GT?;
<资源>
<样式名称=AppTheme父=机器人:款式/ Theme.Material.Light>
<! - 主要主题颜色 - >
<! - 您的应用程序的品牌颜色(应用栏) - >
<项目名称=机器人:colorPrimaryDark> @色/ primary_dark< /项目>
<项目名称=机器人:colorPrimary> @色/初级< /项目>
<! - 暗colorPrimary(为状态栏,上下文的应用程序吧)的变体 - >
<! - 像复选框和文本字段主题UI控件 - >
<项目名称=机器人:colorAccent> @颜色/重音和LT; /项目>
< /风格>
< /资源>
我的colors.xml:
< XML版本=1.0编码=UTF-8&GT?;
<资源>
<颜色名称=主>#03a9f4< /彩色>
<颜色名称=primary_dark>#0091ea< /彩色>
<颜色名称=乡音>#e1f5fe< /彩色>
< /资源>
解决方案
我有同样的问题。而解决这一问题通过改变SDK来
<使用-SDK安卓的minSdkVersion =L的Android版本:targetSdkVersion =L/>
希望它可以提供帮助。
I've been following the new steps for Android L here: http://developer.android.com/preview/material/theme.html I've have been trying to change the colors of the status bar but it doesn't work.
My styles.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="android:style/Theme.Material.Light">
<!-- Main theme colors -->
<!-- your apps branding color (for the app bar) -->
<item name="android:colorPrimaryDark">@color/primary_dark</item>
<item name="android:colorPrimary">@color/primary</item>
<!-- darker variant of colorPrimary (for status bar, contextual app bars) -->
<!-- theme UI controls like checkboxes and text fields -->
<item name="android:colorAccent">@color/accent</item>
</style>
</resources>
My colors.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="primary">#03a9f4</color>
<color name="primary_dark">#0091ea</color>
<color name="accent">#e1f5fe</color>
</resources>
解决方案
I have the same problem. And I fix this by change sdk to
<uses-sdk android:minSdkVersion="L" android:targetSdkVersion="L" />
Hope it can help.
这篇关于Android的L提单主题颜色错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文