ios 获取屏幕的属性和宽度
2015-07-09 14:33
615 查看
app尺寸,去掉状态栏
CGRect r = [ UIScreen mainScreen ].applicationFrame;
r=0,20,320,460
屏幕尺寸
CGRect rx = [ UIScreen mainScreen ].bounds;
r=0,0,320,480
状态栏尺寸
iphone中获取屏幕分辨率的方法
CGRect rect = [[UIScreen mainScreen] bounds];
CGSize size = rect.size;
CGFloat width = size.width;
CGFloat height = size.height;
另外,设计UI的时候,注意用户最小的触控面积。有2种说法
44*44 好像是来自sdk
64*64 来自standford讲义
UIView.animateWithDuration(0.5, animations: { () -> Void in
self.conMainViewMarginTop.constant = UIScreen.mainScreen().bounds.height
self.viewMain.layoutIfNeeded()
})
约束改变后,实现动画的实现, self.viewMain.layoutIfNeeded() 这句话很重要
http://blog.csdn.net/guozh/article/details/8501989
CGRect r = [ UIScreen mainScreen ].applicationFrame;
r=0,20,320,460
屏幕尺寸
CGRect rx = [ UIScreen mainScreen ].bounds;
r=0,0,320,480
状态栏尺寸
CGRect rect; rect = [[UIApplication sharedApplication] statusBarFrame];
iphone中获取屏幕分辨率的方法
CGRect rect = [[UIScreen mainScreen] bounds];
CGSize size = rect.size;
CGFloat width = size.width;
CGFloat height = size.height;
另外,设计UI的时候,注意用户最小的触控面积。有2种说法
44*44 好像是来自sdk
64*64 来自standford讲义
UIView.animateWithDuration(0.5, animations: { () -> Void in
self.conMainViewMarginTop.constant = UIScreen.mainScreen().bounds.height
self.viewMain.layoutIfNeeded()
})
约束改变后,实现动画的实现, self.viewMain.layoutIfNeeded() 这句话很重要
http://blog.csdn.net/guozh/article/details/8501989
相关文章推荐
- iPhone如何打包成一个通用的静态库文件
- ios一键打包
- iOS获取系统语言
- 判断系统时间格式
- iOS MRC转ARC和 MRC 同ARC的共存(混编)
- iOS版本号
- iOS添加日期选择器
- ios中关于检测应用安装和流量信息研究
- iOS中滤镜的使用(三)OpenGLES渲染
- iOS 后台播放
- IOS 时间格式 时间转换 大总结
- iOS 本地缓存实现
- iOS如何才能在招聘中表现得靠谱?
- IOS——duplicate symbol _OBJC_METACLASS_$_ClassName错误(stackoverflow)
- IOS loadView 和 viewDidLoad 的区别
- iOS ViewController生命周期
- iOS 自动登录,登录过程中一直显示加载页
- iOS开发 - CoreLocation地理定位
- [iOS]iOS发送短信
- iOS开发经验技巧之iOS页面间传值的方式(Delegate/NSNotification/Block/NSUserDefault)