Many attempts were made today to modify the share button for the gallery.
1. Find the XML file, as follows
<?xml version= "1.0" encoding= "Utf-8"? ><menu xmlns:android= "http://schemas.android.com/apk/res/ Android "> <item android:id=" @+id/action_share " Android:icon =" @dra Wable/ic_menu_share_holo_light " Android:title =" @string/share " android:enabled = "true" Android:actionproviderclass =" an Droid.widget.ShareActionProvider " android:showasaction =" Ifroom "/> <item android:id= "@+id/action_hotknot" Android:icon = "@drawable/ic_ho Tknot " android:showasaction =" Always " = "@string/hotknot" android:visible = "false"/>&L T;/menu>
1) Try to modify android:icon= "@drawable/ic_menu_share_holo_light" no effect
2) think it is an XML lookup error, verify that modify android:showasaction= "never"/> button hidden, have effect, prove XML file no problem
3) If there is a change in the code, find the place where validation is not modified
4) Finally consider whether there are settings in the theme. Locate the theme settings, as follows
<android:name= "com.android.gallery3d.app.MovieActivity" android: Theme= "@style/theme.funuigallery" android:label= "@string/movie_view_label" android:configchanges= "Orientation|keyboardhidden|screensize|mnc|mcc|keyboard" > </ Activity >
More on this theme,android:theme= "@style/theme.gallery" The discovery icon turns white, proving that the icon can be set in the theme
2. Go to the topic find related properties
<name= "Actionmodesharedrawable"> @android:d rawable/ic_menu_share_funui</Item >
<Itemname= "Actionmodecutdrawable">@android:d Rawable/ic_menu_cut_funui</Item> <Itemname= "Actionmodecopydrawable">@android:d Rawable/ic_menu_copy_funui</Item> <Itemname= "Actionmodepastedrawable">@android:d Rawable/ic_menu_paste_funui</Item> <Itemname= "Actionmodeselectalldrawable">@android:d Rawable/ic_menu_selectall_funui</Item> <Itemname= "Actionmodesharedrawable">@android:d Rawable/ic_menu_share_funui</Item> <Itemname= "Actionmodefinddrawable">@android:d Rawable/ic_menu_find_funui</Item> <Itemname= "Actionmodewebsearchdrawable">@android:d Rawable/ic_menu_search_funui</Item>
<name= "Actionmodesharedrawable"> @android:d rawable/ic_menu_share_funui</ Item>
3. Change to the subject, as follows
<stylename= "Theme.funuigallery"Parent= "Android:Theme.Funui"> <Itemname= "Listpreferreditemheightsmall">48dp</Item> <Itemname= "Switchstyle">@android: Style/widget.compoundbutton</Item> <Itemname= "Android:actionbarstyle">@style/photobarstyle</Item> <Itemname= "*android:actionmodesharedrawable">@drawable/ic_menu_share_holo_light</Item> </style>
Success
Android-shareicon Sharing button Changes