【发布时间】:2012-11-01 09:19:20
【问题描述】:
我必须将滚动视图锁定为纵向而不是横向。
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
scrollview.scrollEnabled=YES;
NSLog(@"inside the landscape rotation");
}
else
{
scrollview.scrollEnabled=NO;
NSLog(@"inside the portrait rotation");
}
}
上述方法工作正常,但我必须旋转一次设备 - 有没有办法在不改变方向的情况下将滚动视图锁定在 potrait 中?
提前致谢。
【问题讨论】:
标签: uiscrollview ios6 orientation uiinterfaceorientation device-orientation