想在viewcontroller中弹出菜单

时间:2013-11-15 10:51:04

标签: ios objective-c uiviewcontroller popup

- (IBAction为)弹出:(ID)发送方    {

NomadPopupViewController *detailViewController = [[NomadPopupViewController alloc] init];
[self presentPopupViewController:detailViewController animationType:MJPopupViewAnimationFade];
//[self dismissPopupViewControllerWithanimationType:MJPopupViewAnimationFade];

}

获取此视图,当我单击leftnavigationbarbutton

时,我想在此视图控制器中有一个弹出菜单

想要这个观点......

1 个答案:

答案 0 :(得分:0)

你可以试试presentViewController,我在我的一个应用程序中尝试

1)将其放在viewDidLoad()

  self.modalPresentationStyle = 
   UIModalPresentationCurrentContext;

2)点击事件

Popup *v2 = [[Popup   alloc]initWithNibName:@"Popup" bundle:nil];

v2.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;

[self presentViewController:v2 animated:YES completion:nil];

3)使用UIViewController制作弹出窗口,因为你想要显示

完成了享受!