如何在ios6中设置iphone 4和iphone 5的帧

Ben*_*n10 5 iphone frame uiview ios6

我想将我的应用程序更新到ios 6.那么如何设置iphone 4和iphone 5的框架尺寸?

Ben*_*n10 4

我可以使用计算屏幕尺寸然后调整视图的高度,就像使用以下方法一样

+(CGFloat)heightOf:(CGFloat)heightValue{
CGRect applicationFrame = [[UIScreen mainScreen] applicationFrame];

//NSLog(@"applciation Frame height = %f",applicationFrame.size.height);
CGFloat heightRatio = (heightValue/480)*100;

CGFloat height = (applicationFrame.size.height * heightRatio)/100;
return height;
Run Code Online (Sandbox Code Playgroud)

}

然后我使用像

UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0,[Height heightOf:385], 320, 220)];
Run Code Online (Sandbox Code Playgroud)

所以。感谢您的回复