重绘scrollView及其内容以横向显示
|
我有一个简单的页面,顶部有导航栏,底部有标签栏,并且滚动视图填充了两者之间的空间。滚动视图包含一个标签和图像以及一个不可滚动的文本视图,该视图动态填充文本并调整大小。我一直在尝试通过使用以下方法使其在横向环境中起作用:
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
if(toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
NSLog(@\"called\");
navBar.frame = CGRectMake(0, 0, 480, 32);
sview.frame = CGRectMake(0, 32, 480, 240);
}
else {
navBar.frame = CGRectMake(0, 0, 320, 44);
sview.frame = CGRectMake(0, 44, 320, 372);
}
}
这使我非常接近,因为导航栏和scrollview的大小正确调整并且可以很好地滚动,但是scrollview中的内容位于左侧。如何重画内容以便在scrollview中正确对齐?
没有找到相关结果
已邀请:
1 个回复
澜悍景哭苟
对于viewDidLoad方法中的每个项目。