【发布时间】:2013-03-29 07:25:27
【问题描述】:
试图让我的 iPad 应用程序以横向模式运行。我想在横向模式下更改一些控件的位置。我得到了日志,所以我知道我在方法中,但是,我的对象都没有移动。我错过了什么吗?
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
if(toInterfaceOrientation==UIInterfaceOrientationLandscapeRight ||
toInterfaceOrientation==UIInterfaceOrientationLandscapeLeft)
{
NSLog(@"in landscape");
// I would like to re-position my controls here but not working
image1.frame = CGRectMake(318, 501, 100, 100);
btnNext.frame = CGRectMake(200, 455, 100, 35)
}
}
【问题讨论】:
-
我在我的 iPad 模拟器 5.0 上对此进行了测试,它在这里工作。看起来这只是较新的iOS的问题。我该如何处理?使用故事板,所以我想支持 5.0 及更高版本。建议?
标签: xcode ipad orientation landscape