动作条又名工具栏是黑色后升级到支持库V21 [英] ActionBar aka Toolbar is black after upgrade to Support Library v21

本文介绍了动作条又名工具栏是黑色后升级到支持库V21的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚升级到最新的库版本后的And​​r​​oid棒棒糖被释放。之后我定serveral的doublicated属性(这其中,所造成的支持库),我更新了我的 Android的开关反向移植 ,并再次进行编译。

I have just upgraded to the newest library version after Android Lollipop was released. After I fixed serveral doublicated attributes (which where caused by the Support Library) I updated my android-switch-backport, and it compiled again.

不过现在我没有更多的动作条,它现在是一个工具栏。到目前为止好,但现在是工具栏黑,我也不知道为什么。

However now I have no more the ActionBar, it is now a Toolbar. So far so good, but now is that Toolbar black and I have no idea why.

所以,我怎么能改回我的自定义颜色,我用 Android的动作栏样式生成器,生成所有必需的资源。

So how can I change it back to my custom colors, I used Android Action Bar Style Generator, for generating all required resources.

推荐答案

在一个安静的漫长的寻找,我发现在的文档,我需要defind的色彩主题。

After a quiet long search I found in the documentation, that I need to defind the colors in the theme.

<style name="Theme.MyTheme" parent="Theme.AppCompat.Light">
    <!-- customize the color palette -->
    <item name="colorPrimary">@color/primary_color</item>
    <item name="colorPrimaryDark">@color/secondary_color</item>
    <item name="colorAccent">@color/accent_color</item>
</style>

现在我可以删除了Android操作栏样式生成器生成的图像,因为我不需要他们了。

Now I can remove the images generated by the Android Action Bar Style Generator, since I don't need them anymore.

这篇关于动作条又名工具栏是黑色后升级到支持库V21的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆