[英]iOS AutoLayout Storyboard Landscape Orientation UIButton doesn't accept touch
[英]Orientation iOS storyboard don't rotate?
好的,这可能是菜鸟,但是我找不到解决方法。 我将iPad UIViewController拖到情节提要中,并将方向设置为YES。 但是由于某种原因,这种观点并没有改变。 顶部的状态栏正在旋转,但旋转iPad时内部的视图,表格视图和标签未旋转。 有人知道为什么以及如何解决它吗?
- (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;
}
}
我认为这将对您有所帮助。
状态栏旋转可能意味着某些模态搜索无法正确消除,只是检查一下即可。 同样,如果其在导航控制器中,请确保已将堆栈中的所有视图设置为返回YES。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.