更改uiorientation后获取相同的帧

时间:2012-09-14 12:56:34

标签: objective-c ios

您好我一直在尝试通过计算不同组件的高度和宽度以及百分比来为所有方向编写一个代码。我在画像中得到320乘460帧,这是好的,但是当我改变为横向模式时出现问题,即使现在我得到相同的尺寸但实际上我应该得到460乘320.

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{


    NSLog(@"%f-%f",self.view.frame.size.width,self.view.frame.size.height);
}

我也试过了其他功能,但仍未成功

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{


 NSLog(@"%f-%f",self.view.frame.size.width,self.view.frame.size.height);

}

0 个答案:

没有答案
相关问题