iOS导航栏、状态栏及Tabbar高度(区分iPhone X与其他iPhone机型)

2021-01-12 22:20:49


#define kIs_iphone (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)

#define kIs_iPhoneX kScreenWidth >=375.0f && kScreenHeight >=812.0f&& kIs_iphone

 

/*状态栏高度*/

#define kStatusBarHeight (CGFloat)(kIs_iPhoneX?(44.0):(20.0))

/*导航栏高度*/

#define kNavBarHeight (44)

/*状态栏和导航栏总高度*/

#define kNavBarAndStatusBarHeight (CGFloat)(kIs_iPhoneX?(88.0):(64.0))

/*TabBar高度*/

#define kTabBarHeight (CGFloat)(kIs_iPhoneX?(49.0 + 34.0):(49.0))

/*顶部安全区域远离高度*/

#define kTopBarSafeHeight (CGFloat)(kIs_iPhoneX?(44.0):(0))

/*底部安全区域远离高度*/

#define kBottomSafeHeight (CGFloat)(kIs_iPhoneX?(34.0):(0))

/*iPhoneX的状态栏高度差值*/

#define kTopBarDifHeight (CGFloat)(kIs_iPhoneX?(24.0):(0))

/*导航条和Tabbar总高度*/

#define kNavAndTabHeight (kNavBarAndStatusBarHeight + kTabBarHeight)


  • 2017-11-06 01:00:17

    撤销git add

    如何撤销git add,不小心执行了git add . 操作,但是又不能提交所有的文件,因为对应不同的分支,现在怎么样可以将git add 撤销回来

  • 2017-11-10 00:06:15

    CORS: credentials mode is 'include'

    XMLHttpRequest cannot load http://localhost/Foo.API/token. The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://localhost:5000' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.