试图让我的 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)
}
}