【发布时间】:2012-06-12 15:29:41
【问题描述】:
我正在使用:
if (UIInterfaceOrientationLandscapeLeft | UIInterfaceOrientationLandscapeRight)
{
viewofimage.frame = CGRectMake(130, 45, 220, 115);
share.frame = CGRectMake(205, 161, 70, 70);
invite.frame = CGRectMake(8, 161, 70, 70);
contact.frame = CGRectMake(402, 161, 70, 70);
invitation.frame = CGRectMake(3, 227, 81, 21);
sharing.frame = CGRectMake(200, 227, 81, 21);
contacting.frame = CGRectMake(397, 227, 81, 21);
}
else
{
viewofimage.frame = CGRectMake(20, 64, 280, 206);
invite.frame = CGRectMake(8, 285, 70, 70);
share.frame = CGRectMake(125, 285, 70, 70);
contact.frame = CGRectMake(242, 285, 70, 70);
invitation.frame = CGRectMake(3, 358, 81, 21);
sharing.frame = CGRectMake(120, 358, 81, 21);
contacting.frame = CGRectMake(237, 358, 81, 21);
}
旋转时在特定位置设置按钮和标签。唯一的问题是,当我离开该视图控制器并转到另一个控制器时,使用相同的代码,它不会将按钮和标签移动到定义的 CGRECTMAKE 值。它仅在选定的视图控制器旋转时移动它们。如何让其他视图控制器检测它所处的方向,并在到达它们时正确调整其大小?
【问题讨论】:
标签: iphone xcode resize orientation