我有react native页面,通过它我可以重定向Native ViewController,但是单击后退按钮时,我无法从Native ViewController返回到React-Native页面。我已经在后按时添加了日志,并在控制台中获取了日志,但是ViewController并没有被关闭。
func goToNativeView() {
self.window = UIWindow(frame: UIScreen.main.bounds)
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let initialViewController = storyboard.instantiateViewController(withIdentifier: "ProfilePageInner")
self.window?.rootViewController = initialViewController self.window?.makeKeyAndVisible()
}
- (IBAction)BackButton:(id)sender {
NSLog(@"BACKBUTTONPRESSED");
[self dismissViewControllerAnimated:YES completion:nil];
}