react-native-navigation的迁移库

RNNCustomViewController.m 606B

123456789101112131415161718192021222324252627282930
  1. #import "RNNCustomViewController.h"
  2. @implementation RNNCustomViewController {
  3. NSString* _text;
  4. }
  5. - (instancetype)initWithProps:(NSDictionary *)props {
  6. self = [super init];
  7. _text = props[@"text"];
  8. return self;
  9. }
  10. - (void)viewDidLoad {
  11. [super viewDidLoad];
  12. [self addTestLabel];
  13. }
  14. - (void)addTestLabel {
  15. UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
  16. label.textAlignment = NSTextAlignmentCenter;
  17. label.numberOfLines = 2;
  18. label.center = self.view.center;
  19. label.text = _text;
  20. label.accessibilityIdentifier = @"TestLabel";
  21. [self.view addSubview:label];
  22. }
  23. @end