好的,这可能很菜鸟,但我找不到解决方法。
我将 iPad UIViewController 拖到 Storyboard 并启用方向为 YES。但由于某种原因,该 View 没有旋转。顶部的状态栏正在旋转,但当您旋转 iPad 时,内部的 View 、表格 View 和标签不会旋转。任何人都知道为什么以及如何解决它?
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; }
最佳答案
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
//return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
if ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight)) {
//implement your code
return (interfaceOrientation != UIInterfaceOrientationLandscapeRight);
} else {
return YES;
}
}
我想这会对你有所帮助。
关于iphone - 方向iOS Storyboard不旋转?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10732903/