react-native-navigation的迁移库

RNNCustomViewController.m 666B

12345678910111213141516171819202122232425262728293031
  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. [[self view] setBackgroundColor:UIColor.whiteColor];
  14. }
  15. - (void)addTestLabel {
  16. UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
  17. label.textAlignment = NSTextAlignmentCenter;
  18. label.numberOfLines = 2;
  19. label.center = self.view.center;
  20. label.text = _text;
  21. label.accessibilityIdentifier = @"TestLabel";
  22. [self.view addSubview:label];
  23. }
  24. @end