1

I have a toolbar:

<android.support.v7.widget.Toolbar
        android:id="@+id/my_toolbar"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
 ...

I would like to use my own icon for the overflow icon showing on the right side of the toolbar. So, I tried:

    // I am using ButterKnife library to bind views
    @BindView(R.id.my_toolbar)
    Toolbar mToolBar;

    @Override public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
            ButterKnife.bind(this);
            setSupportActionBar(mToolBar);

            // use my_icon.png for overflow icon of toolbar 
       mToolBar.setOverflowIcon(getResources().getDrawable(R.drawable.my_icon));
        }

When I run my app, there is no overflow icon showing.... Why?

How to customize overflow icon of ToolBar?

Leem
  • 17,220
  • 36
  • 109
  • 159
  • `android:layout_width="0dp"` Give it some width... – sharp Nov 20 '17 at 14:19
  • https://stackoverflow.com/questions/29038861/how-to-change-toolbar-navigation-and-overflow-menu-icons-appcompat-v7 – Sandeep Sankla Nov 20 '17 at 14:22
  • I am using ConstraintLayout, this is what constriant layout gives... I should only care about the margin to border. – Leem Nov 20 '17 at 14:22
  • Possible duplicate of [How to change Toolbar Navigation and Overflow Menu icons (appcompat v7)?](https://stackoverflow.com/questions/29038861/how-to-change-toolbar-navigation-and-overflow-menu-icons-appcompat-v7) – stan0 Nov 20 '17 at 14:35

0 Answers0