是否可以在 iOS 应用中显示工具提示?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9731371/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is it possible to show a tooltip in an iOS app?
提问by user1184202
I want to show a tooltip whenever user clicks an image in my app. I just want to know whether it is possible to show tooltip in an iOS app.
我想在用户单击我的应用程序中的图像时显示工具提示。我只想知道是否可以在 iOS 应用程序中显示工具提示。
回答by Devin M
There are a few ways you can do this, however I have had luck with the CMPopTipViewproject. As far as tool tips go its a good fit for tutorials and similar events.
有几种方法可以做到这一点,但是我在CMPopTipView项目上很幸运。就工具提示而言,它非常适合教程和类似事件。
Is this what you were looking for?
这就是你要找的吗?
回答by Pascalius
You are looking for UIMenuController
您正在寻找UIMenuController
Since iOS 3.2 you can add your own menu items to the editing menu via the menuItems property.
由于iOS 3.2,你可以自己添加菜单项通过的菜单项属性编辑菜单。
回答by erenkabakci
I had a similar problem and ended up writing my own custom tooltip. It might be a solution for you.
我遇到了类似的问题,最终编写了自己的自定义工具提示。它可能是您的解决方案。
You can init with your custom view (i assume you write some delegations to detect actions within.) and present from anywhere.
您可以使用自定义视图进行初始化(我假设您编写了一些委托来检测其中的操作。)并从任何地方呈现。
Maybe not the best replacement of UIPopoverController but still works great. And a lifesaver for iPhone. Also highly customisable.
也许不是 UIPopoverController 的最佳替代品,但仍然很好用。也是 iPhone 的救星。也高度可定制。
https://github.com/akeara/AKETooltip
https://github.com/akeara/AKETooltip
Hope this helps.
希望这可以帮助。