react-native-navigation的迁移库

RNNReactRootView.m 661B

12345678910111213141516171819202122232425
  1. #import "RNNReactRootView.h"
  2. @implementation RNNReactRootView
  3. - (void)setRootViewDidChangeIntrinsicSize:(void (^)(CGSize))rootViewDidChangeIntrinsicSize {
  4. _rootViewDidChangeIntrinsicSize = rootViewDidChangeIntrinsicSize;
  5. self.delegate = self;
  6. }
  7. - (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView {
  8. if (_rootViewDidChangeIntrinsicSize) {
  9. _rootViewDidChangeIntrinsicSize(rootView.intrinsicContentSize);
  10. }
  11. }
  12. - (void)setAlignment:(NSString *)alignment {
  13. if ([alignment isEqualToString:@"fill"]) {
  14. self.sizeFlexibility = RCTRootViewSizeFlexibilityWidthAndHeight;
  15. } else {
  16. self.sizeFlexibility = RCTRootViewSizeFlexibilityNone;
  17. }
  18. }
  19. @end