gpt4 book ai didi

iphone - 如何在ios6中设置iphone 4和iphone 5的边框

转载 作者:行者123 更新时间:2023-12-03 18:54:33 25 4
gpt4 key购买 nike

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

最佳答案

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

+(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;

}

然后我使用like as

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

等等。谢谢您的回复

关于iphone - 如何在ios6中设置iphone 4和iphone 5的边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12814004/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com