UINavigationBar 中的菜单

发布于 2024-12-21 11:33:29 字数 149 浏览 4 评论 0原文

有没有一种简单的方法来实现这样的菜单?或者我必须自己用 popoverViewController 和几个 UIButtons 构建它?

多谢!

菜单

Is there an easy way to achieve a menu like this? Or do I have to build it with a popoverViewController and several UIButtons by myself?

Thanks a lot!

Menu

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心凉 2024-12-28 11:33:29

您可以尝试使用 UIActionSheet 并使用以下方法来呈现它:

- (void)showFromBarButtonItem:(UIBarButtonItem *)item animated:(BOOL)animated

我没有尝试过,但从文档来看它看起来很有希望。

此方法也可能具有相同的效果:

- (void)showFromRect:(CGRect)rect inView:(UIView *)view animated:(BOOL)animated

You could try to use a UIActionSheet and use the following method to present it:

- (void)showFromBarButtonItem:(UIBarButtonItem *)item animated:(BOOL)animated

I did not try it out, but it looks promising from the docs.

This method might also have the same effect:

- (void)showFromRect:(CGRect)rect inView:(UIView *)view animated:(BOOL)animated
萌酱 2024-12-28 11:33:29

你是对的,使用UIPopoverController,并添加你自己的内容。有用的教程

You're right, use UIPopoverController, and add you're own content. Useful tutorial.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文