iPad上的UIModalPresentationFullScreen(iOS 5.0 / 5.1)很糟糕,为什么?

时间:2013-06-12 06:56:17

标签: ios

//在一个按钮上点击当前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;
 }

0 个答案:

没有答案