iphone4s和iphone5屏幕尺寸的兼容
如果我们没有考虑到5的尺寸,我们把应用在5上跑一下会发现,上下多出来一道黑条。
这就需要我们有一定的针对性。
我们可以这样:
#define isIPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ?
CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#define ScreenHeight [[UIScreen mainScreen] bounds].size.height
#define ScreenWidth [[UIScreen mainScreen] bounds].size.width
#define StateBarHeight 20
#define MainHeight (ScreenHeight - StateBarHeight)
#define MainWidth ScreenWidth
UILabel *lab=[[UILabel alloc]init];
--------------第一种----------
// if (isIPhone5)
// {
// [lab setFrame:CGRectMake(0, 528, 320, 20)];
// }
// else
// {
// [lab setFrame:CGRectMake(0, 440, 320, 20)];
// }
--------------第二种----------
[lab setFrame:CGRectMake(0, MainHeight-20, 320, 20)];
lab.backgroundColor=[UIColor redColor];
[self.view addSubview:lab];
iphone4s和iphone5屏幕尺寸的兼容相关推荐
- 0119吧 iPhone 屏幕尺寸
1.iPhone尺寸规格 设备 iPhone 宽 Width 高 Height 对角线 Diagonal 逻辑分辨率(point) Scale Factor 设备分辨率(pixel) PPI 3GS ...
- html5开发之ios屏幕适配,iOS开发屏幕尺寸以及屏幕适配等问题(转载内容)
原帖地址:http://blog.csdn.net/phunxm/article/details/42174937/ 仅供我个人收藏学习,原博主如不同意请联系qq651263878进行删除,在此表示感 ...
- iphone屏幕尺寸总结
http://blog.csdn.net/phunxm/article/details/42174937#t24 1.iPhone尺寸规格 设备 iPhone 宽 Width 高 Height 对角线 ...
- iOS 屏幕尺寸、分辨率、适配
1.iPhone尺寸规格 设备 iPhone 宽 Width 高 Height 对角线 Diagonal 逻辑分辨率(point) Scale Factor 设备分辨率(pixel) PPI 3GS ...
- IOS 开发 iPhone屏幕尺寸、分辨率及适配
版权声明:本文为博主原创文章,未经博主允许不得转载. 目录(?)[+] 1.iPhone尺寸规格 设备 iPhone 宽 Width 高 Height 对角线 Diagonal 逻辑分辨率(point ...
- ios学习7_iPhone屏幕尺寸、分辨率及适配
1.iPhone尺寸规格 设备 iPhone 宽 Width 高 Height 对角线 Diagonal 逻辑分辨率(point) Scale Factor 设备分辨率(pixel) PPI 3GS ...
- 关于iPhone屏幕尺寸、分辨率及适配
1.iPhone尺寸规格 设备 iPhone 宽 Width 高 Height 对角线 Diagonal 逻辑分辨率(point) Scale Factor 设备分辨率(pixel) PPI 3GS ...
- iPhone屏幕尺寸、分辨率及适
原作者传送http://blog.csdn.net/phunxm/article/details/42174937 1.iPhone尺寸规格 设备 iPhone 宽 Width 高 Height 对角 ...
- iOS 【iOS iPhone屏幕尺寸、分辨率及屏幕适配】
1.iPhone尺寸规格 设备 iPhone 宽 Width 高 Height 对角线 Diagonal 逻辑分辨率(point) Scale Factor 设备分辨率(pixel) PPI 3GS ...
最新文章
- 数据分析从零开始实战,Pandas读写Excel/XML数据
- actor multithreading concurrency
- jBPM4.4 no jBPM DB schema:
- complex--创建复数
- 计算机网络:网络设备知识笔记
- css sprite原理优缺点及使用
- 一篇文章搞懂filebeat(ELK)
- 查看目录下所有文件 dir 。
- c# opencv车牌识别_牛逼plus的springboot+maven车牌识别开源系统
- C#联合halcon应用——大华相机采集类
- 核方法概述----正定核以及核技巧(Gram矩阵推导正定核)
- 自己动手做个智能小车(2)
- 硬件设计3---什么是电容?
- 点云粗配准之采样一致性
- java视频转换flv_java使用ffmpeg转换视频为flv文件
- 用robot framework + python实现http接口自动化测试框架
- DMZ主机的使用设置
- 《3D数学基础:图形与游戏开发》 学习笔记(一)
- minio下载安装与API操作
- 没有权限打开服务器共享文件夹权限,Win 7无法访问共享文件夹,提示您可能没有权限使用网络资源。...