我有这段代码(Book1 是 UIViewController 类)
Book1 *book = [self.storyboard instantiateViewControllerWithIdentifier:@"Book1ID"];
[UIView transitionFromView:self.view toView:book.view duration:1 options:UIViewAnimationOptionTransitionCurlDown completion:nil];
ViewController 加载但它的方向是错误的。它以纵向视图加载,但我希望它以横向加载。
我已经在 Book1 中有以下代码,但是一旦加载了视图,所有自动旋转似乎都失败了。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
return interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight;}
如何在横向中加载此视图?