react-native-navigation中的ScreenVisibilityListener

时间:2018-01-12 18:18:33

标签: react-native-android wix-react-native-navigation

我使用下面的代码注册以了解屏幕的变化。 我使用SharedElementTransition时出现问题。按下屏幕。它不会触发记录的事件。 有没有人经历过这个?

版本: react-native-cli:2.0.1 反应原生:0.47.1 反应天然导航:1.1.256

注册活动屏幕:

["A='5' or A='5' and C='Hello' and B='ABCD'"]

推屏:

export const registerScreenVisibilityListener = (store) => {
  new ScreenVisibilityListener({
    willAppear: ({screen}) => console.log(`Screen will disappear ${screen}`),
    didAppear: ({screen}) => console.log(`Screen will disappear ${screen}`),
    willDisappear: ({screen}) => console.log(`Screen will disappear ${screen}`),
    didDisappear: ({screen}) => console.log(`Screen disappeared ${screen}`)
  }).register();
}

0 个答案:

没有答案