Android-shareicon Sharing button Changes

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.