我可以将UIMenuController子类化,以便它可以使用图标而不仅仅是文本吗? [英] Can I subclass UIMenuController so that it can take icons instead of just text?
问题描述
怎么会这样做呢?我正在寻找一个密集,纯粹的图形菜单。
How would one go about doing this? I'm looking for a dense, purely graphical menu on tap-hold.
推荐答案
在3.2中你可以使用以下方法添加菜单项 menuItems
属性。但我认为子类化将没有用,因为它是一个不返回每个菜单项视图的单例。当 setMenuVisible:animated:
被调用时,您可以访问 menuFrame
,这样您就可以添加自己的视图带有图标的菜单项。但是为了向系统菜单项添加图标......我认为你应该坚持苹果给你的东西;)
In 3.2 you can add menu items using the menuItems
property. But I think subclassing won't be useful, since it's a singleton that does not returns the views of each menu item. You could access menuFrame
when setMenuVisible:animated:
is called, so you can add you're own view that looks like a menu items with icons. But for adding icons to the system menu items... I think you should stick to what's Apple is giving you ;)
这篇关于我可以将UIMenuController子类化,以便它可以使用图标而不仅仅是文本吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!