[英]How to implement a BottomTabNavigator in React Native?
我是 React Native 的新手,我正在努力在我的 LoggedIn 屏幕上實現一個 BottomTabNavigator。 下面是我的 App.js 文件中的代碼,以實現導航結構,盡管我沒有看。 有人可以告訴我代碼有什么問題並解釋如何成功實現它嗎? 非常感激。
我有兩個屏幕:LoggedIn 和 PostMessage。
import React from 'react';
import { View, Text} from 'react-native';
import { createBottomTabNavigator } from "react-navigation-tabs";
import PostMessage from "../screens/PostMessage";
import LoggedIn from "../screens/LoggedIn";
const BottomTab = createBottomTabNavigator({
LoggedIn: {
screen: LoggedIn
},
PostMessage: {
screen: PostMessage
},
});
export default BottomTab;
這個片段似乎有很多遺漏。 話雖如此,您可以考慮使用 React Navigation 5。它非常易於使用且非常強大,可以提供您可能需要的所有導航流,而不僅僅是選項卡。 下面是一些關於選項卡的使用鏈接,另一個用於使用它的一般導航
https://reactnavigation.org/docs/tab-based-navigation
https://reactnavigation.org/blog/2020/01/29/using-react-navigation-5-with-react-native-paper
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.