TXAdapter适配

作者: _YN | 来源:发表于2019-07-17 11:44 被阅读0次

如果您在阅读我的文章时有疑问 , 请点击这里
导入头文件

#import "TXAdapter.h"

用一个View举例

UIView * view=[[UIView alloc]initWithFrame:CGRectMake(0, 0, tRealLength(50), tRealLength(50))];
    NSLog(@"真实长度:%f",tRealLength(50));
    view.backgroundColor=[UIColor redColor];
    [self.view addSubview:view];

输出设备

NSLog(@"当前设备");
    switch (tCurrentType()) {
        case TXAdapterPhoneType_iPhone3GS_4_4S:
            NSLog(@"TXAdapterPhoneType_iPhone3GS_4_4S");
            break;
        case TXAdapterPhoneType_iPhone5_5C_5S_5SE:
            NSLog(@"TXAdapterPhoneType_iPhone5_5C_5S_5SE");
            break;
        case TXAdapterPhoneType_iPhone6_6S_7_8:
            NSLog(@"TXAdapterPhoneType_iPhone6_6S_7_8");
            break;
        case TXAdapterPhoneType_iPhone6Plus_6SPlus_7Plus_8Plus:
            NSLog(@"TXAdapterPhoneType_iPhone6Plus_6SPlus_7Plus_8Plus");
            break;
        case TXAdapterPhoneType_iPhoneX:
            NSLog(@"TXAdapterPhoneType_iPhoneX");
            break;
        case TXAdapterPhoneTypeOther:
            break;
        default:
            break;
    }

相关文章

  • TXAdapter适配

    如果您在阅读我的文章时有疑问 , 请点击这里导入头文件 用一个View举例 输出设备

  • 适配iOS11,适配iPhoneX,适配安全区的几个文章和宏

    适配iOS11,适配iPhoneX,适配安全区的几个文章和宏 适配iOS11,适配iPhoneX,适配安全区的几个...

  • App适配

    布局适配 字体适配 软键盘适配

  • 版本适配

    屏幕适配 代码适配 Masonry UIView+AutoLayout 可视化适配 autoLayout 系统适配...

  • Android屏幕适配

    px适配; 百分比适配; 修改dp适配; 屏幕适配 布局适配使用wrap_content,match_parent...

  • 屏幕适配

    适配 什么是适配?适应、兼容各种不同的情况 iOS开发中的适配?系统适配针对不同版本的操作系统进行适配屏幕适配针对...

  • iOS 适配器模式

    适配器模式创建适配协议,创建抽象适配器类,创建类适配器/对象适配器。 应用,适用场景电源适配器,普通充电器(类适配...

  • iPhone X 适配 ( iOS 11适配 ) 打理刘海

    iPhone X 适配 ( iOS 11适配 ) 打理刘海 iPhone X 适配 ( iOS 11适配 ) 打理刘海

  • iOS设计模式 (五) 适配器模式

    适配器模式 iOS中的适配器模式,主要由目标协议,适配者,适配器三部分组成. 适配器模式分类 类适配器: 适配器是...

  • 设计模式-适配器

    适配器模式,目的是为了适配补偿,对于适配器模式,我们要学习的两种方式是类适配器和对象适配器。 类适配器 类适配器是...

网友评论

    本文标题:TXAdapter适配

    本文链接:https://www.haomeiwen.com/subject/gehqlctx.html