【发布时间】:2017-06-27 10:34:35
【问题描述】:
我是 iOS 的新手,我学习了客观的 c 语言。 在这里,我尝试使用滚动视图和屏幕旋转,下面的代码是发布的,当运行应用程序时滚动视图无法显示或工作,但经过四次旋转滚动视图工作。 所以请帮助我。 谢谢。
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) {
//Landscape
/*self.view.frame = CGRectMake(0, 0, 1024, 728);
self.view.hidden = NO;*/
//self.scrollView.frame = CGRectMake(0, 0, 1024, 728);
[_scrollView setContentSize:CGSizeMake(736, 1000)];
} else {
//self.view.frame = CGRectMake(0, 0, 414, 800);
[_scrollView setContentSize:CGSizeMake(414 , 1200)];
//self.View.hidden=NO;
//self.view.hidden=YES;
}
}
【问题讨论】:
标签: ios objective-c uiscrollview