react-native-navigation的迁移库

RNNSubtitleOptions.m 948B

12345678910111213141516171819202122232425262728293031
  1. #import "RNNSubtitleOptions.h"
  2. @implementation RNNSubtitleOptions
  3. - (NSDictionary *)fontAttributes {
  4. NSMutableDictionary* navigationBarTitleTextAttributes = [NSMutableDictionary new];
  5. if (self.fontFamily || self.fontSize || self.color) {
  6. // if (self.color) {
  7. // navigationBarTitleTextAttributes[NSForegroundColorAttributeName] = [RCTConvert UIColor:self.color];
  8. // }
  9. if (self.fontFamily){
  10. if (self.fontSize) {
  11. navigationBarTitleTextAttributes[NSFontAttributeName] = [UIFont fontWithName:self.fontFamily size:[self.fontSize floatValue]];
  12. } else {
  13. navigationBarTitleTextAttributes[NSFontAttributeName] = [UIFont fontWithName:self.fontFamily size:14];
  14. }
  15. } else if (self.fontSize) {
  16. navigationBarTitleTextAttributes[NSFontAttributeName] = [UIFont systemFontOfSize:[self.fontSize floatValue]];
  17. }
  18. }
  19. return navigationBarTitleTextAttributes;
  20. }
  21. - (NSNumber *)fontSize {
  22. return _fontSize ? _fontSize : @(14);
  23. }
  24. @end