pengwang
pengwang

Reputation: 19956

change the default "more' image for the options menu when i have 6 menus

i want to change the default "more' image for the options menu when i have 6 menus,i can modifu the frist 5 menu by :

menu.add(MENU_GROUP_HOMESCREEN, MENU_WALLPAPER_SETTINGS, 0,  R.string.menu_wallpaper)
             .setIcon(R.drawable.ic_menu_gallery)
             .setAlphabeticShortcut('W');

but the 6th menu .i donot know how to modify its icon,it used the defualt icon how to modify it .i used :

menu.findItem(6) or menu.getItem(6).setIcon(R.drawable.ic_menu_add); but no effect,can you give me info.thank you

Upvotes: 0

Views: 827

Answers (1)

Vasu
Vasu

Reputation: 4982

I do not know whether this will help you or not, but one possible way is to make custom "More" button e.g

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item ...
        ... />
    <item ...
        ... />
    <item ...
        ... />
    <item ...
        ... />
    <item ...
        ... />  

    <item android:id="@+id/menu_more"
    android:title="More" 
    android:icon="your_custom_icon">
       <menu xmlns:android="http://schemas.android.com/apk/res/android">
            <item ...
                ... />
            ...
            ...
            <item ...
                ... /> 
       </menu>
    </item>
</menu>

Upvotes: 3

Related Questions