更改向上箭头的颜色后标记为私人警告 [英] Marked as private warning after changing colour of up arrow

查看:261
本文介绍了更改向上箭头的颜色后标记为私人警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在操作栏中为后退箭头定义自定义颜色后,将返回警告。可以做些什么来消除这个警告?

After defining a custom colour for the back arrow in the action bar, a warning is then returned. What can be done to get rid of this warning?

        final Drawable upArrow = ContextCompat.getDrawable(this, R.drawable.abc_ic_ab_back_mtrl_am_alpha);
        upArrow.setColorFilter(Color.BLUE, PorterDuff.Mode.SRC_ATOP);
        actionBar.setHomeAsUpIndicator(upArrow);




资源@ drawable / abc_ic_ab_back_mtrl_am_alpha在com.android中标记为私有.support:appcompat -v7

The resource @drawable/abc_ic_ab_back_mtrl_am_alpha is marked as private in com.android.support:appcompat-v7


推荐答案

参见 Android库中的私人资源,原因及修复。

简而言之,drawable / abc_ic_ab_back_mtrl_am_alpha来自appcompat-v7,旨在由该库使用 only 。你不应该使用它。

In short, drawable/abc_ic_ab_back_mtrl_am_alpha comes from appcompat-v7 and is intended to be used only by that library. You should not use it.

如果你真的想使用它,把它复制到你的项目中

If you really want to use it, copy it to your project


最佳做法是复制资源供私人使用

the best practice is to copy the resources for private use

这篇关于更改向上箭头的颜色后标记为私人警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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