从另一个呈现的模态视图控制器呈现模态视图控制器

时间:2012-08-20 13:38:02

标签: objective-c ios xcode ipad modalviewcontroller

我有一个呈现的视图控制器,然后将呈现另一个视图控制器。第二个视图控制器不会使其下方的视图透明或禁用任何下面的视图控件。有没有人碰到这个,你怎么能解决它?

//view controller for invalid username/password popup
IncorrectPasswordViewController *viewController = [[IncorrectPasswordViewController alloc] init];
viewController.view.layer.borderColor = [UIColor whiteColor].CGColor;
viewController.view.layer.borderWidth = 3.0f;

//push the modal on the screen
viewController.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentViewController:viewController animated:YES completion: nil];
CGRect r = CGRectMake(self.view.bounds.size.width/2 - 150,
                      self.view.bounds.size.height/2 - 70,
                      300, 140);
r = [self.view convertRect:r toView:viewController.view.superview.superview];
viewController.view.superview.frame = r;

0 个答案:

没有答案