我可以使用计算屏幕尺寸然后调整视图的高度,就像使用以下方法一样
+(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)
所以。感谢您的回复
| 归档时间: |
|
| 查看次数: |
5683 次 |
| 最近记录: |