如果您在閱讀我的文章時有疑問 , 請點擊這里
導(dǎo)入頭文件
#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];
輸出設(shè)備
NSLog(@"當(dāng)前設(shè)備");
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;
}