react-native-navigation的迁移库

Constants.m 650B

12345678910111213141516171819202122
  1. #import "Constants.h"
  2. @implementation Constants
  3. + (NSDictionary *)getConstants {
  4. return @{@"topBarHeight": @([self topBarHeight]), @"statusBarHeight": @([self statusBarHeight]), @"bottomTabsHeight": @([self bottomTabsHeight])};
  5. }
  6. + (CGFloat)topBarHeight {
  7. return UIApplication.sharedApplication.delegate.window.rootViewController.navigationController.navigationBar.frame.size.height;
  8. }
  9. + (CGFloat)statusBarHeight {
  10. return [UIApplication sharedApplication].statusBarFrame.size.height;
  11. }
  12. + (CGFloat)bottomTabsHeight {
  13. return UIApplication.sharedApplication.delegate.window.rootViewController.tabBarController.tabBar.frame.size.height;
  14. }
  15. @end