【问题标题】:UIViewController - UIModalPresentationCurrentContext not rotating presentingViewControllerUIViewController - UIModalPresentationCurrentContext 不旋转presentingViewController
【发布时间】:2013-10-27 05:28:47
【问题描述】:

我曾经以UIModalPresentationCurrentContext 的演示风格呈现来自另一个UIViewControllerUIViewController。但它不允许我旋转presentingviewcontroller(呈现新UIViewControllerUIViewController

self.modalPresentationStyle = UIModalPresentationCurrentContext;
NewViewController *newViewController = [[NewViewController alloc] initWithNibName:@"NewViewController" Bundle: nil];
[self presentViewController:newViewController animated:YES completion:nil];

当我旋转设备时,它会旋转newViewControllerstatusbar,但不会旋转presentingViewController

PS:这里presentingViewControllerself

【问题讨论】:

  • 正在呈现任何其他控制器的 ViewController 子级吗?也许你忘了把它作为一个孩子添加,它没有得到任何事件。
  • 不,它是 rootViewController。
  • 在其他演示样式中它可以正常工作,但在 UIModalPresentationCurrentContext 中则不行。
  • 我也面临同样的问题......你有答案吗?

标签: iphone ios objective-c ipad uiviewcontroller


【解决方案1】:

使用UIModalPresentationFormSheet 代替UIModalPresentationCurrentContext

试试这个

self.modalPresentationStyle = UIModelPresentationFormSheet; NewViewController *newViewController = [[NewViewController alloc] initWithNibName:@"NewViewController" Bundle: nil]; [self presentViewController:newViewController animated:YES completion:nil];

【讨论】:

  • UIModalPresentationFormSheet 在 iPhone 中不可用
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-11-18
  • 2011-01-25
  • 2012-09-26
  • 2012-03-27
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多