预编译文件信息以及iPhone的尺寸

1.预编译文件信息


#ifndef myDefintion_pch

#define myDefintion_pch


#define Margin  5

#define Padding 10

#define iOS8TopMargin 64 //导航栏44,状态栏20

//判断当前的iOS系统是否是8.0及以上系统

#define IOS8_OR_LATER   ( [[[UIDevice currentDevice] systemVersion] compare:@"8.0"] != NSOrderedAscending )

//判断当前正在运行的设备是IPhone还是IPad,若是1则为IPhone

#define isIphone    [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone

//自定义颜色

#define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1]


#define ButtonHeight 44

//导航栏高度

#define NavigationBarHeight 44

//当前手机屏幕的宽高

#define ScreenWidth   [UIScreen mainScreen].bounds.size.width

#define ScreenHeight  [UIScreen mainScreen].bounds.size.height

#ifdef DEBUG

//打印当前信息的所在的文件名(即当前的viewController),当前所在的函数名,当前所在的行号,当前要打印的信息

# define DLog(fmt, ...) NSLog((@"[文件名:%s]\n" "[函数名:%s]\n" "[行号:%d] \n" fmt), __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__);

#else

# define DLog(...);

#endif



#ifdef __IPHONE_6_0

# define IFLY_ALIGN_CENTER NSTextAlignmentCenter

#else

# define IFLY_ALIGN_CENTER UITextAlignmentCenter

#endif


#ifdef __IPHONE_6_0

# define IFLY_ALIGN_LEFT NSTextAlignmentLeft

#else

# define IFLY_ALIGN_LEFT UITextAlignmentLeft

#endif



#endif /* myDefintion_pch */


2.iphone的尺寸分辨率

//iPhone宽高

//iPhone 4S          3.5    320x480

//iPhone 5//c/s    4     320x568

//iPhone 6(/s/)      4.7    375x667

//iPhone 6(/p/sp/)   5.5    414x736

//iPhone 7           4.7    375x667

//iPhone 7p          5.5    414x736



发布了69 篇原创文章 · 获赞 19 · 访问量 26万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章