简体   繁体   中英

Android Action Bar Icon Opacity

在此处输入图片说明

Hi There,

I am new to Android programming and using Android studio for my development. As you can see from the screenshot, I've got a "refresh icon" but it is more of a gray color and I want to make it white. Here is my style. There is no gray color used in the style and I don't know which item I should use to override its gray color.. Please help!

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="popupMenuStyle">@style/PopupMenu.Coin</item>
    <item name="dropDownListViewStyle">@style/DropDownListView.Coin</item>
    <item name="actionBarTabStyle">@style/ActionBarTabStyle.Coin</item>
    <item name="actionDropDownStyle">@style/DropDownNav.Coin</item>
    <item name="actionBarStyle">@style/ActionBar.Solid.Coin</item>
    <item name="actionModeBackground">@drawable/cab_background_top_coin</item>
    <item name="actionModeSplitBackground">@drawable/cab_background_bottom_coin</item>
    <item name="actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Coin</item>
    <item name="android:windowContentOverlay">@null</item>
</style>

<style name="ActionBar.Solid.Coin" parent="@android:style/Widget.Holo.Light.ActionBar.Solid">
    <item name="background">@drawable/ab_solid_coin</item>
    <item name="backgroundStacked">@drawable/ab_stacked_solid_coin</item>
    <item name="backgroundSplit">@drawable/ab_bottom_solid_coin</item>
    <item name="progressBarStyle">@style/ProgressBar.Coin</item>
    <item name="android:windowContentOverlay">@null</item>
</style>

<style name="ActionBar.Transparent.Coin" parent="@android:style/Widget.Holo.Light.ActionBar">
    <item name="background">@drawable/ab_transparent_coin</item>
    <item name="progressBarStyle">@style/ProgressBar.Coin</item>
    <item name="android:windowContentOverlay">@null</item>
</style>

Consider using something like Android Asset Studio to create an icon with the desired opacity.

They already have a bunch of free to use (CCA 3.0) icons (including the same refresh icon you're using) and you can easily modify the opacity by modifying the opacity controller next to the 'Custom color' option.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM