ios版本适配,机型适配,横竖屏适配
来源:互联网 发布:淘宝购物流程图模板 编辑:程序博客网 时间:2024/05/20 06:27
1,版本适配: iOS系统的判定,这个可以通过[[[UIDevice currentDevice] systemVersion] floatValue]来获得当前的系统版本。
2,机型适配(屏幕尺寸):
#define DEVICE_IS_IPHONE4S ([[UIScreenmainScreen] bounds].size.height == 480)
#define DEVICE_IS_IPHONE5 ([[UIScreenmainScreen] bounds].size.height == 568)
#define DEVICE_IS_IPHONE6 ([[UIScreenmainScreen] bounds].size.height == 667)
#define DEVICE_IS_IPHONE6_Plus ([[UIScreenmainScreen] bounds].size.height == 960)
3,横竖屏适配:(根据使用layoutSubviews方法,检测横竖屏)-(void)layoutSubviews{
[super layoutSubviews];
UIDeviceOrientation interfaceOrientation = [[UIApplicationsharedApplication] statusBarOrientation];
if(interfaceOrientation ==UIDeviceOrientationPortrait || interfaceOrientation ==UIDeviceOrientationPortraitUpsideDown){
//翻转为竖屏时
[self setVerticalFrame];
}else if (interfacePrientation ==UIDeviceOrientationLandscapeLeft || interfaceOrientation ==UIDeviceOrientationLandscapeRight){
//翻转为横屏时
[self setHorizontalFrame];
}
}
-(void)setVerticalFrame
{
NSLog(@"竖屏");
[titleLable setFrame:CGRectMake(283,0,239,83)];
[leftView setFrame:CGRectMake(34,102,384,272)];
}
-(void)setHorizontalFrame
{
NSLog(@"横屏");
[titleLable setFrame:CGRectMake(183, 0, 239, 83)];
}
- ios版本适配,机型适配,横竖屏适配
- Android机型适配
- android 机型适配
- 机型适配
- 机型适配
- Android 机型适配
- Android机型适配
- iOS机型适配,5,6,6p机型宏定义
- J2ME 机型适配经验谈
- 关于机型适配浅见
- android 机型适配问题
- android机型适配问题
- 根据机型画质适配
- Android之机型适配
- 各种机型屏幕适配
- Android AlertDialog适配机型
- 谈谈Android机型适配
- Android机型适配总结
- iOS视频播放器开发
- #pragma预处理命令
- QQ获取TK 转换
- TabHost分析
- 棋盘覆盖问题
- ios版本适配,机型适配,横竖屏适配
- windows 如何查看端口占用情况?
- SQL Server 2012将不再支持XP系统
- 关于机顶盒焦点的获取,及事件响应!!
- enum可以添加新方法-枚举类型
- IOS之UILabel添加下划线
- 使用plsql连接本地数据库
- 如何用T-SQL使用最短的语句输出100以内素数?
- HDU 1728 逃离迷宫