12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- //
- // Common.h
- // Demo
- //
- // Created by cindy on 2020/5/29.
- // Copyright © 2020 Seqster. All rights reserved.
- //
- #ifndef Common_h
- #define Common_h
-
- #import "UIColor+expanded.h"
- #import "UIViewExt.h"
- //取得屏幕的宽、高
- #define kScreenWidth [UIScreen mainScreen].bounds.size.width
- #define kScreenHeight [UIScreen mainScreen].bounds.size.height
- //获取图片资源
- #define JXGetImage(imageName) [UIImage imageNamed:[NSString stringWithFormat:@"%@",imageName]]
- /*** 粗体 */
- #define kBoldFont(size) [UIFont boldSystemFontOfSize:size]
- /*** 普通字体 */
- #define kFont(size) [UIFont systemFontOfSize:size]
- #define RGBColor(r,g,b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1]
- #define UIColorHex(_hex_) [UIColor colorWithHexString:((__bridge NSString *)CFSTR(#_hex_))]
- #define kBlackColor [UIColor blackColor]
- #define kDarkGrayColor [UIColor darkGrayColor]
- #define kLightGrayColor [UIColor lightGrayColor]
- #define kWhiteColor [UIColor whiteColor]
- #define kGrayColor [UIColor grayColor]
- #define kRedColor [UIColor redColor]
- #define kGreenColor [UIColor greenColor]
- #define kBlueColor [UIColor blueColor]
- #define kCyanColor [UIColor cyanColor]
- #define kYellowColor [UIColor yellowColor]
- #define kMagentaColor [UIColor magentaColor]
- #define kOrangeColor [UIColor orangeColor]
- #define kPurpleColor [UIColor purpleColor]
- #define kClearColor [UIColor clearColor]
- // iPhone X系列(X和XS是一样的宽高,XR和XMAX是一样的,刘海的status和底部的34跟X是一致的
- #define XS_iPhoneX ((kScreenWidth == 375.f && kScreenHeight == 812.f ? YES : NO)||(kScreenWidth == 812.f && kScreenHeight == 375.f ? YES : NO)|| (kScreenWidth == 414.f && kScreenHeight == 896.f ? YES : NO)|| (kScreenWidth == 896.f && kScreenHeight == 414.f ? YES : NO))
- // Tabbar height.
- #define XS_TabbarHeight (XS_iPhoneX ? (49.f+34.f) : 49.f)
- // Tabbar safe bottom margin.
- #define XS_TabbarSafeBottomMargin (XS_iPhoneX ? 34.f : 0.f)
- #define XS_StatusBarAndNavigationBarHeight (XS_iPhoneX ? 88.f : 64.f)
- #endif /* Common_h */
|