简体   繁体   English

Android L Theme.Material无法识别

[英]Android L Theme.Material not being recognized

I'm trying to change my app's status and navigation bar colors and so far nothing I've tried has worked. 我正在尝试更改应用程序的状态和导航栏颜色,到目前为止,我尝试过的所有操作均无效。 My project is targeted to L. 我的项目针对L。

Here is my styles.xml in values-v21 folder. 这是我在values-v21文件夹中的styles.xml。

<style name="CalcTheme" parent="android:Theme.Material">        
    <item name="android:colorPrimaryDark">@color/primary_dark</item>
    <item name="android:colorPrimary">@color/primary</item>
    <item name="android:colorAccent">@color/accent</item>

    <item name="android:statusBarColor">@color/primary_dark</item>
    <item name="android:navigationBarColor">@color/primary_dark</item>
</style>

The problem is none of these changes are working when I run the project on my Nexus 5 (running L) 问题是,当我在Nexus 5上运行项目(运行L)时,这些更改均不起作用

改成 :

<style name="CalcTheme" parent="@android:style/Theme.Material">   

as of oct 2014 i am able to see the changes in the emulator but not inside the layout preview. 从2014年10月开始,我可以在模拟器中看到更改,但在布局预览中看不到。 just for reference i was refering to this tutorial https://developer.android.com/training/material/theme.html 仅供参考,我指的是本教程https://developer.android.com/training/material/theme.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 看不到Theme.Material或Android L的东西 - cannot see Theme.Material or Android L's things 在android studio中找不到“Theme.Material” - Cannot find “Theme.Material” in android studio 带有Theme.Material的Android设计支持库 - Android design support library with Theme.Material Android 中的 Theme.AppCompat 和 Theme.Material 有什么区别? - What is the difference between Theme.AppCompat and Theme.Material in Android? 错误:获取AppCompatActivity与android:Theme.Material不兼容 - Error: Getting AppCompatActivity is not compatible with android:Theme.Material 找不到与给定名称“android:Theme.Material”匹配的资源 - No resource found that matches the given name 'android:Theme.Material' 如何同时使用android:Theme.Material和工具栏? - How to use android:Theme.Material and Toolbar together? 如何在styles.xml android中使用android:Theme.Material(Material theme)? - How to use android:Theme.Material (Material theme) in styles.xml android? Android Studio 1.3:Theme.Material.Light和Theme.Material提供错误 - Android Studio 1.3: Theme.Material.Light and Theme.Material Giving Error 无法将ActionBarActivity与Theme.Material一起使用 - Can't use ActionBarActivity with Theme.Material
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM