第一个参数是保存菜单的对象;第二个参数是菜单对象的名字,它是从XML中获得的。
The first argument is the object that holds the menu; the second argument is the menu object's name, taken from the XML.
我们储存在每个菜单项对象中的数据是一个仅包含一个元素的数组:类别名。
The data we store in each menu item object is an array containing only one element: the name of the category.
第二行代码从事件获取菜单数据对象。
The second line retrieves the menu data object from the event.
应用推荐