0

I am trying to create a context menu which should look like


MenuItem1 O

MenuItem2 O

MenuItem3 O

MenuItem4 ✔</h2>

MenuItem5 ✔</h2>

Is it possible to do the same? Please note that I know that using setGroupCheckable I can create a group of checkable radio button menuItems, and using setCheckable for individual items, I can get checkbox menuItems but how to get both in the same menu is the issue that I am facing. http://developer.android.com/guide/topics/ui/menus.html is a good reference for radio buttons and checbox menus.

Any idea anyone?

4

1 回答 1

0

我终于找到了实现这一目标的方法,因此想到了与他人分享。

您可以使用不同的组 id 将各种菜单项添加到同一个菜单,因此,对于一个组,您可以将 setGroupCheckable 设置为 true(这使得该组单选按钮),而您可以将另一组的单个菜单项设置为可检查(setCheckable(true)),它们变成了复选框。

于 2013-01-24T08:41:21.837 回答