Bru*_*mos 3 react-native react-native-navigation
所以,有一个屏幕我正在使用javascript导航栏而不是react-native-navigation导航(因为这个bug).
我需要显示一个后退按钮,如果它可以返回(如果它不是堆栈中的第一个屏幕).
有什么方法可以检查它是否可以返回?像navigator.canBoBack()或的东西navigator.getCurrentScreenStack().lenght > 1.
检查屏幕的commandType支柱是否为Push或者相应地ShowModal调用设置按钮.
const canGoBack =
this.props.commandType === 'Push' ||
this.props.commandType === 'ShowModal'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2928 次 |
| 最近记录: |