iOS 屏幕适配
2016-01-05 23:14
411 查看
/article/2321330.html
(1)UIScreen.bounds
// Bounds of entire screen in points(本地坐标系,起点为[0,0])@property(nonatomic,readonly) CGRect bounds;
--------------------------------------------------------------------------------
//考虑转屏的影响,按照实际屏幕方向(UIDeviceOrientation)的宽高
#define SCREEN_WIDTH ([UIScreenmainScreen].bounds.size.width)
#define SCREEN_HEIGHT ([UIScreenmainScreen].bounds.size.height)
#define STATUSBAR_HEIGHT ([UIApplicationsharedApplication].statusBarFrame.size.height)
//不考虑转屏的影响,只取竖屏(UIDeviceOrientationPortrait)的宽高
#define SCREEN_WIDTH MIN([UIScreenmainScreen].bounds.size.width,
[UIScreenmainScreen].bounds.size.height)
#define SCREEN_HEIGHT MAX([UIScreenmainScreen].bounds.size.height,
[UIScreenmainScreen].bounds.size.width)
#define STATUSBAR_HEIGHT MIN([UIApplicationsharedApplication].statusBarFrame.size.width,
[UIApplicationsharedApplication].statusBarFrame.size.height)
相关文章推荐
- iOS 实现背景颜色渐变的方式
- iOS原生扫码实现及原理
- iOS读取plist文件存为NSArray但为nil
- iOS开发之MVVM在项目中的应用
- 芒果iOS开发之AFNetworking3.0.4使用指南
- 阿里云ECS服务器的使用
- Win7+虚拟机OS X 10.8.5+Xcode4.6.3+越狱iPhone4+iOS5.1.1真机调试及生成ipa包
- IOS中随机数的获取
- iOS开发学习之OC篇1、类的创建
- 分析iOS Crash文件,使用命令符号化iOS Crash文件
- 关于新版本iOS(7.1)离线文档的安装
- iOS8下获取相册所有图片
- iOS 获取图像的方式与坑点
- iOS开发~CocoaPods使用详细说明
- iOS屏幕适配-约束
- iOS深入学习(使用CocoaPods进行第三方资源管理)(转)
- ios textField限制只能输入一定长度的字符
- iOS页面间传值的两种方式
- iOS - 内存管理
- ios distill failed for unknow reasons解决