How to add actionbar white icon in android

拥有回忆 提交于 2019-12-12 06:18:54

问题


I'm trying to add actionbar icon into the android studio and i've do this:

Go to ImageAssets and set the icon for Actionbar and TabIcons and then refer that in menu icon.

But, it's a little bit black when the app compiled, like this:

as you can see, search icon is a little bit black.

So, what is the problem?

I've tried this with copy pasting the icon into drawable(without adding in ImageAssets) and it was white but, it's haven't any good resolution or quality.

How we can add a right or correct way for add actionbar icon like White color action icon into the actionbar?


回答1:


If you want white icon, select CUSTOM theme instead of holo dark or holo white when you import your asset and change color to #FFFFFF, or just manually copy it into drawable-hdpi, drawable-mdpi, drawable-xhdpi, drawable-xxhdpi and drawable xxxhdpi




回答2:


Solved with android:icon="@drawable/abc_ic_search_api_mtrl_alpha" Private resource

And i think it's an android Studio bug which is when we are adding this, it's a little bit black.



来源:https://stackoverflow.com/questions/32904042/how-to-add-actionbar-white-icon-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!