-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
How to change/hide menu items on bottomsheet Toolbar #42
Comments
You probably don't want to do this in the Behavior, but in your Activity's
(or Fragment's) onCreateOptionsMenu
…On Mar 17, 2017 11:45 PM, "Rakesh Kashyap" ***@***.***> wrote:
I tried to add mToolbar.getMenu().clear(); in init() of
MergedAppBarLayoutBehavior. But It did not clear the menu items. is there
something that I am missing?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#42>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADoGr2Xbh-QIGd2kkPim62FXfj0Bw3J5ks5rm311gaJpZM4MhUJ1>
.
|
correct me if i am wrong... Activty/Fragment's onCreateOptionsMenu would change the toolbar that was set for the activity itself. In my layout xml i have 2 Toolbars. one for activity and one for BottomSheet. How will I change it for BottomSheet's toolbar? |
Ok, you can try something like this (in your onActivityCreated or whenever
you want to modify the toolbar:
final Toolbar scroll_toolbar = (Toolbar) findViewById( R.id.scrolltoolbar );
scroll_toolbar.setTitle( "Title" );
scroll_toolbar.inflateMenu( R.menu.scroll );
…On Mar 18, 2017 12:53 AM, "Rakesh Kashyap" ***@***.***> wrote:
correct me if i am wrong... Activty/Fragment's onCreateOptionsMenu would
change the toolbar that was set for the activity itself. How will I change
it for BottomSheet's toolbar?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#42 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADoGr3XYtaApaljz6XmQhxmO0C5-49XKks5rm41igaJpZM4MhUJ1>
.
|
Assuming that you are referring to the second toolbar. I tried this in oncreate of the activity. It did not change the title or inflate the menu. I am modifying the latest version of the repo. |
I tried to add
mToolbar.getMenu().clear();
in init() of MergedAppBarLayoutBehavior. But It did not clear the menu items. is there something that I am missing?The text was updated successfully, but these errors were encountered: