UIScreen(FWAdaptive)

@interface UIScreen (FWAdaptive)

/// 屏幕尺寸
@property (class, nonatomic, assign, readonly) CGSize fw_screenSize NS_REFINED_FOR_SWIFT;
/// 屏幕宽度
@property (class, nonatomic, assign, readonly) CGFloat fw_screenWidth NS_REFINED_FOR_SWIFT;
/// 屏幕高度
@property (class, nonatomic, assign, readonly) CGFloat fw_screenHeight NS_REFINED_FOR_SWIFT;
/// 屏幕像素比例
@property (class, nonatomic, assign, readonly) CGFloat fw_screenScale NS_REFINED_FOR_SWIFT;
/// 是否是指定英寸屏幕
+ (BOOL)fw_isScreenInch:(FWScreenInch)inch NS_REFINED_FOR_SWIFT;
/// 是否是全面屏屏幕
@property (class, nonatomic, assign, readonly) BOOL fw_isNotchedScreen NS_REFINED_FOR_SWIFT;

/// 获取一像素的大小
@property (class, nonatomic, assign, readonly) CGFloat fw_pixelOne NS_REFINED_FOR_SWIFT;
/// 检查是否含有安全区域,可用来判断iPhoneX
@property (class, nonatomic, assign, readonly) BOOL fw_hasSafeAreaInsets NS_REFINED_FOR_SWIFT;
/// 获取安全区域距离
@property (class, nonatomic, assign, readonly) UIEdgeInsets fw_safeAreaInsets NS_REFINED_FOR_SWIFT;

/// 状态栏高度,与是否隐藏无关
@property (class, nonatomic, assign, readonly) CGFloat fw_statusBarHeight NS_REFINED_FOR_SWIFT;
/// 导航栏高度,与是否隐藏无关
@property (class, nonatomic, assign, readonly) CGFloat fw_navigationBarHeight NS_REFINED_FOR_SWIFT;
/// 顶部栏高度,包含状态栏、导航栏,与是否隐藏无关
@property (class, nonatomic, assign, readonly) CGFloat fw_topBarHeight NS_REFINED_FOR_SWIFT;
/// 标签栏高度,与是否隐藏无关
@property (class, nonatomic, assign, readonly) CGFloat fw_tabBarHeight NS_REFINED_FOR_SWIFT;
/// 工具栏高度,与是否隐藏无关
@property (class, nonatomic, assign, readonly) CGFloat fw_toolBarHeight NS_REFINED_FOR_SWIFT;

/// 指定等比例缩放参考设计图尺寸,默认{375,812},宽度常用
@property (class, nonatomic, assign) CGSize fw_referenceSize NS_REFINED_FOR_SWIFT;
/// 获取当前屏幕宽度缩放比例,宽度常用
@property (class, nonatomic, assign, readonly) CGFloat fw_relativeScale NS_REFINED_FOR_SWIFT;
/// 获取当前屏幕高度缩放比例,高度不常用
@property (class, nonatomic, assign, readonly) CGFloat fw_relativeHeightScale NS_REFINED_FOR_SWIFT;

/// 获取相对设计图宽度等比例缩放值
+ (CGFloat)fw_relativeValue:(CGFloat)value NS_REFINED_FOR_SWIFT;

/// 获取相对设计图高度等比例缩放值
+ (CGFloat)fw_relativeHeight:(CGFloat)value NS_REFINED_FOR_SWIFT;

/// 获取相对设计图宽度等比例缩放时的固定宽度值
+ (CGFloat)fw_fixedValue:(CGFloat)value NS_REFINED_FOR_SWIFT;

/// 获取相对设计图高度等比例缩放时的固定高度值
+ (CGFloat)fw_fixedHeight:(CGFloat)value NS_REFINED_FOR_SWIFT;

/// 基于当前设备的屏幕倍数,对传进来的floatValue进行像素取整
+ (CGFloat)fw_flatValue:(CGFloat)value NS_REFINED_FOR_SWIFT;

/// 基于指定的倍数(0取当前设备),对传进来的floatValue进行像素取整
+ (CGFloat)fw_flatValue:(CGFloat)value scale:(CGFloat)scale NS_REFINED_FOR_SWIFT;

@end

Undocumented

  • 屏幕尺寸

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) CGSize fw_screenSize;
  • 屏幕宽度

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) CGFloat fw_screenWidth;
  • 屏幕高度

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) CGFloat fw_screenHeight;
  • 屏幕像素比例

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) CGFloat fw_screenScale;
  • 是否是指定英寸屏幕

    Declaration

    Objective-C

    + (BOOL)fw_isScreenInch:(FWScreenInch)inch;
  • 是否是全面屏屏幕

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) BOOL fw_isNotchedScreen;
  • 获取一像素的大小

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) CGFloat fw_pixelOne;
  • 检查是否含有安全区域,可用来判断iPhoneX

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) BOOL fw_hasSafeAreaInsets;
  • 获取安全区域距离

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) UIEdgeInsets fw_safeAreaInsets;
  • 状态栏高度,与是否隐藏无关

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) CGFloat fw_statusBarHeight;
  • 导航栏高度,与是否隐藏无关

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) CGFloat fw_navigationBarHeight;
  • 顶部栏高度,包含状态栏、导航栏,与是否隐藏无关

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) CGFloat fw_topBarHeight;
  • 标签栏高度,与是否隐藏无关

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) CGFloat fw_tabBarHeight;
  • 工具栏高度,与是否隐藏无关

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) CGFloat fw_toolBarHeight;
  • 指定等比例缩放参考设计图尺寸,默认{375,812},宽度常用

    Declaration

    Objective-C

    @property (class, nonatomic) CGSize fw_referenceSize;
  • 获取当前屏幕宽度缩放比例,宽度常用

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) CGFloat fw_relativeScale;
  • 获取当前屏幕高度缩放比例,高度不常用

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) CGFloat fw_relativeHeightScale;
  • 获取相对设计图宽度等比例缩放值

    Declaration

    Objective-C

    + (CGFloat)fw_relativeValue:(CGFloat)value;
  • 获取相对设计图高度等比例缩放值

    Declaration

    Objective-C

    + (CGFloat)fw_relativeHeight:(CGFloat)value;
  • 获取相对设计图宽度等比例缩放时的固定宽度值

    Declaration

    Objective-C

    + (CGFloat)fw_fixedValue:(CGFloat)value;
  • 获取相对设计图高度等比例缩放时的固定高度值

    Declaration

    Objective-C

    + (CGFloat)fw_fixedHeight:(CGFloat)value;
  • 基于当前设备的屏幕倍数,对传进来的floatValue进行像素取整

    Declaration

    Objective-C

    + (CGFloat)fw_flatValue:(CGFloat)value;
  • 基于指定的倍数(0取当前设备),对传进来的floatValue进行像素取整

    Declaration

    Objective-C

    + (CGFloat)fw_flatValue:(CGFloat)value scale:(CGFloat)scale;