0

怎么做呢?我正在寻找一个密集的、纯图形的点击保持菜单。

4

3 回答 3

1

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 ;)

于 2010-12-10T23:57:41.430 回答
1

我的低声誉不允许我发布链接,因此我在这里再次回答:

检查表情符号和符号,也许它适合您的目的。

转到您的 Xcode 菜单 -> 编辑 -> 表情符号和符号。

前任。:

let menuItemYes = UIMenuItem(title: "✅", action: "doSomething")

祝你好运!

于 2015-06-06T15:51:44.287 回答
0

I wrote a category to support image for UIMenuItem. It's based on method swizzling, but should be safe in most cases.

https://github.com/cxa/CXAImageMenuItem

Note: duplicate answer to https://stackoverflow.com/a/14140904/395213

EDIT: the above link is 404'ed, this link works

https://github.com/cxa/UIMenuItem-CXAImageSupport

于 2013-01-04T09:20:45.150 回答