//在当前VC内部的一个按钮上单击此代码应该执行
AViewController *Controller = [[AViewController alloc] initWithWithString:@"Hello"];
Controller.delegate = self;
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:Controller];
navController.navigationBarHidden = YES;
//在 iPAD 上,iOS 6.0 或更高版本一切正常,但在 iOS 5.0/5.1 上出现空白白屏,上面什么都没有。如果我使用 UIModalPresentationCurrentContext 而不是一切正常但 AViewController 上的手势事件被传递给我不想要的父控制器。
navController.modalPresentationStyle = UIModalPresentationFullScreen;//why this is not working
navController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentViewController:navController animated:YES completion:nil];
[Controller release];
[navController release];
// AViewController 自定义初始化
- (id) initWithString:(NSString*) string
{
self = [self initWithNibName:@"AViewController" bundle:nil];
if(self)
{
self.text = string;
}
return self;
}
-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}