【问题标题】:How to pop UIViewController from UIView?如何从 UIView 弹出 UIViewController?
【发布时间】:2011-01-04 07:26:03
【问题描述】:

从 rootViewController,我用两个按钮刷出一个 320x50 大小的 UIView。

点击UIView中的按钮,如何弹出一个UIViewController?

谢谢。

【问题讨论】:

  • 我已经用另一种方式解决了这个问题。当点击 UIView 中的按钮时,我使用 NSNotificationCenter 向 rootViewController 发布通知。然后让 rootViewController 弹出另一个 UIViewController。

标签: iphone uiview uiviewcontroller


【解决方案1】:

// 创建导航控制器

 UINavigationController *navController = [[UINavigationController alloc]
     initWithRootViewController:viewController];

 // show the navigation controller modally
 [youCurrentNavigationController presentModalViewController:navController animated:YES];

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-05-22
    • 2023-04-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-23
    • 1970-01-01
    相关资源
    最近更新 更多