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); 
    } 
}
posted @ 2012-08-25 20:50  zyip  阅读(213)  评论(0)    收藏  举报