ipad/iphone ,adjust your layout when orientation will be changing , 旋转屏幕时调整界面布局
- (void)willAnimateRotationToInterfaceOrientation: (UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
self.firstButton.frame = CGRectMake(20, 20, 482, 708);
self.secondButton.frame = CGRectMake(522, 20, 482, 708);
}
else
{
self.firstButton.frame = CGRectMake(20, 20, 728, 472);
self.secondButton.frame = CGRectMake(20, 512, 728, 207);
}
}
{
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
self.firstButton.frame = CGRectMake(20, 20, 482, 708);
self.secondButton.frame = CGRectMake(522, 20, 482, 708);
}
else
{
self.firstButton.frame = CGRectMake(20, 20, 728, 472);
self.secondButton.frame = CGRectMake(20, 512, 728, 207);
}
}