Reputation: 767
I have a MenuItem
list, and I wanna set the view of each MenuItem
with a TextView
and a RadioButton
, but for default it just allow me set the view for Checkable
(menuItem.setCheckable(true)
). Exists any way to set this MenuItems
on a RadioButton
option or set an custom view, where I can custom the view for RadioButton
option?
Upvotes: 0
Views: 1868
Reputation: 767
Not for set an custom View, but to resolve my issue I did something like this:
subMenu.setGroupCheckable(groupId, true, true);
But only after the subMenu items are all added.
Upvotes: 1
Reputation: 25584
This question was asked a few days before yours: Custom views in actionbar
Upvotes: 1
Reputation: 3127
try something similar like this on onCreateOptionsMenu:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
getSupportMenuInflater().inflate(R.menu.home, menu);
MenuItem spin = menu.findItem(R.id.menu_spinner);
spin.setActionView(channelsSpinner);
return true;
}
Upvotes: 0