以编程方式在纵向视图中显示根控制器弹出窗口

发布于 2024-09-08 07:32:21 字数 111 浏览 2 评论 0原文

有没有办法以编程方式以纵向模式显示根视图控制器来响应用户操作?

在我的应用程序中,根视图控制器可以响应某些用户与详细控制器的交互进行更新,我想在发生这种情况时将其弹出。

谢谢!

Is there any way to programatically show the root view controller in portrait mode responding to a user action?

in my app the root view controller can be updated responding to some user interaction with the detail controller and i'd like to pop it over when that happens.

Thanks!

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

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

发布评论

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

评论(1

拒绝两难 2024-09-15 07:32:21

如果你想弹出根视图控件,那么使用UIPopOverController

self.QuickSearchPopView = [[[QuickSearchPopView alloc]
    initWithNibName:@"QuickSearchPopView" 
    bundle:[NSBundle mainBundle]] autorelease];

//create a popover controller
self.popoverController = [[[UIPopoverController alloc]
    initWithContentViewController:self.QuickSearchPopView] autorelease];

//present the popover view non-modal with a
//refrence to the button pressed within the current view
[self.popoverController presentPopoverFromRect:self.view.frame
    inView:self.view
    permittedArrowDirections:UIPopoverArrowDirectionAny
    animated:YES];

If you want to pop up the root view control, then use UIPopOverController:

self.QuickSearchPopView = [[[QuickSearchPopView alloc]
    initWithNibName:@"QuickSearchPopView" 
    bundle:[NSBundle mainBundle]] autorelease];

//create a popover controller
self.popoverController = [[[UIPopoverController alloc]
    initWithContentViewController:self.QuickSearchPopView] autorelease];

//present the popover view non-modal with a
//refrence to the button pressed within the current view
[self.popoverController presentPopoverFromRect:self.view.frame
    inView:self.view
    permittedArrowDirections:UIPopoverArrowDirectionAny
    animated:YES];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文