美文网首页
react native跟原生自由跳转

react native跟原生自由跳转

作者: 明少2018 | 来源:发表于2017-05-23 20:31 被阅读0次

1、启动时【目的是为了react native跳转到原生时使用原来的RCTBridge,react native就不行重新加载了】

_bridge= [[RCTBridgealloc]initWithDelegate:self launchOptions:launchOptions];

RCTRootView*rootView = [[RCTRootViewalloc]initWithBridge:_bridge moduleName:@"GroupChatApp" initialProperties:initProps];

self.window= [[UIWindowalloc]initWithFrame:[UIScreenmainScreen].bounds];

UIViewController*rootViewController = [UIViewControllernew];

rootViewController.view= rootView;

self.navigation= [[UINavigationControlleralloc]initWithRootViewController:rootViewController];

self.navigation.navigationBarHidden=YES;

self.window.rootViewController=self.navigation;

相关文章

网友评论

      本文标题:react native跟原生自由跳转

      本文链接:https://www.haomeiwen.com/subject/hmvgxxtx.html