iOS7 屏幕高度,状态栏高度,标签栏尺寸等获取方式
关于新的获取屏幕高度,状态栏尺寸,标签栏尺寸的获取方法,找了多个资料和文章,其方法总结如下
App尺寸,去掉状态栏
1 | CGRect r = [ UIScreen mainScreen ].applicationFrame; |
gowhich得到的结果如下:
1 | 2013-11-28 12:09:22.188 寻艺[49308:70b] r.height = 548.000000,r.width = 320.000000,r.x = 0.000000,r.y = 20.000000 |
屏幕尺寸
1 | CGRect rx = [UIScreen mainScreen].bounds; |
得到的结果如下:
1 | 2013-11-28 12:09:22.189 寻艺[49308:70b] rx.height = 568.000000,rx.width = 320.000000,rx.x = 0.000000,rx.y = 0.000000 |
状态栏尺寸
1 | CGRect rect = [[UIApplication sharedApplication] statusBarFrame]; |
得到的结果如下:
1 | 2013-11-28 12:14:18.972 寻艺[49617:70b] rect.height = 20.000000,rect.width = 320.000000,rect.x = 0.000000,rect.y = 0.000000 |
iPhone中获取屏幕分辨率的方法
1 | CGRect rect = [[UIScreen mainScreen] bounds]; |
另外,设计UI的时候,注意用户最小的触控面积。有2种说法
44*44
好像是来自sdk
64*64
来自standford讲义
参考文章:
http://blog.csdn.net/linzhiji/article/details/6764738