react-native-navigation的迁移库

RNNTestRootViewCreator.m 699B

123456789101112131415161718
  1. #import "RNNTestRootViewCreator.h"
  2. @implementation RNNTestRootViewCreator
  3. - (RNNReactView *)createRootView:(NSString *)name rootViewId:(NSString *)rootViewId ofType:(RNNComponentType)componentType reactViewReadyBlock:(RNNReactViewReadyCompletionBlock)reactViewReadyBlock {
  4. UIView *view = [[UIView alloc] initWithFrame:UIScreen.mainScreen.bounds];
  5. UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
  6. label.textAlignment = NSTextAlignmentCenter;
  7. label.center = [view convertPoint:view.center fromView:view.superview];;
  8. label.text = rootViewId;
  9. [view addSubview:label];
  10. view.tag = [rootViewId intValue];
  11. view.backgroundColor = UIColor.redColor;
  12. return view;
  13. }
  14. @end