UIViewController作为弹出窗口

时间:2012-07-31 10:22:30

标签: iphone ios uiviewcontroller

我在静态lib中有ViewController。

也有公共接口
  • presentPopup:
  • presentInNavigationVC:(UINavigation ...)

是否可以在其他viewController中将我的ViewController显示为弹出窗口,最好的方法是什么? 我想我必须将viewController视图作为subView添加到其他ViewController视图中。 但是,在弹出模式和将viewController推送到navigationController之间切换应该是完整的逻辑。

Popup应该看起来像FBDialog:

Facebook popup

1 个答案:

答案 0 :(得分:1)

设置该视图控制器的视图大小,并使用addsubview方法[[self view] addSubview:bar];将其添加到parentviewcontroller中。当你的进程结束时,使用remove from superview方法删除该视图lke this [presentingController.view removeFromSuperview];

相关问题