更改向上箭头的颜色后标记为私人警告 [英] Marked as private warning after changing colour of up arrow
问题描述
为操作栏中的后退箭头定义自定义颜色后,将返回警告.可以做些什么来摆脱这个警告?
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 中被标记为私有
参见 选择资源公开的原因.
简而言之,drawable/abc_ic_ab_back_mtrl_am_alpha 是 appcompat-v7 的私有资源,旨在仅由该库使用.你不应该使用它.
如果你真的想使用它,把它复制到你的项目中
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);
The resource @drawable/abc_ic_ab_back_mtrl_am_alpha is marked as private in com.android.support:appcompat-v7
See Choose resources to make public for the reason.
In short, drawable/abc_ic_ab_back_mtrl_am_alpha is a private resource of 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
这篇关于更改向上箭头的颜色后标记为私人警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!