Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
275 views
in Technique[技术] by (71.8m points)

java - Marked as private warning after changing colour of up arrow

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 Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...