//在一个按钮上点击当前VC中的这段代码应该执行
AViewController *Controller = [[AViewController alloc] initWithWithString:@"Hello"];
Controller.delegate = self;
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:Controller];
navController.navigationBarHidden = YES;
//在iPAD上iOS 6.0 / 5.1空白屏幕上的iOS 6.0或以上版本都可以 没有任何内容。如果我使用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自定义init
- (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;
}