React-nativeNavigatorIOSコンポーネント



React Native Navigatorios Component




多くのアプリにナビゲーションバーがあることがわかっているので、それらをRNに実装する方法は、NavigatorIOSコンポーネント(このコンポーネントはiOS専用)を使用します。クロスプラットフォームソリューションを参照してください。 ナビゲーション または ネイティブ-ナビゲーションreact-native-navigation

次に、次のステップバイステップコードを実装しましょう。



  • 最初の一歩
    新しいNavigatorIOSExample.jsファイルを作成します
  • 第二段階
    コードのすぐ下
export default class NavigatorIOSExample extends Component { render() { return ( ) } } class MyScene extends Component { static propTypes = { title: PropTypes.string.isRequired, navigator: PropTypes.object.isRequired, } _onForward = () => { // alert(this.props.navigator.pop) this.props.navigator.push({ component: Scene, title: 'Scene', leftButtonTitle: 'return', onLeftButtonPress: () => { this.props.navigator.pop() } }) } render() { return ( Current Scene: {this.props.title} Tap me to load the next scene ) } }

NavigatorIOSは、ルートを介してサブビュー、小道具、ナビゲーションバーなどを処理します。
initalRouteの上部に注意する必要があります。

  • コンポーネントが必要です
  • passPropsこれは、このプロパティの最初の公式例では処理されません。サブコンポーネントはthis.props.titleを直接呼び出し、タイトルが未定義であることを警告する警告が表示されます。したがって、小道具を処理するには、passPropsが必要です。