简体   繁体   中英

Share button in ActionBar icon not default. How to change it?

I added share button to my ActionBar, but icon of that button seems not ok.

Default button looks like that: https://monosnap.com/image/yiBpHo6XcMWKmXD1zwcy2w2gRkFBPN.png

But in my case it looks just like "SHARE" textin actionBar: https://monosnap.com/image/d8cXbr5XIFtwItoaXAKkTjVBPr5eEa.png

How to change it to default?

Here is my menu xml file for activity:

<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.XXXXXXX.XXXXXXXXXXX.app.SomeActivity" >
<item
        android:id="@+id/menu_item_share"
        app:showAsAction="always"
        android:title="Share"
        android:actionProviderClass= "android.widget.ShareActionProvider" />
</menu>

add this

android:icon="@android:drawable/ic_menu_share"

 <item
    android:id="@+id/menu_item_share"
   android:orderInCategory="100"
    android:title="Share"
    android:icon="@drawable/ic_launcher"
    app:showAsAction="always"/>

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