作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想将我的应用程序更新到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/
我是一名优秀的程序员,十分优秀!