react-native - 反应导航混合导航
问题描述
我使用 react-navigation 来构建我的应用程序,我想要标签和堆栈导航,所以我这样做了:
const FindPage = StackNavigator({
Find: {
screen: Find,
},
Item:{
screen:Item
}
}, {
initialRouteName: 'Find',
});
const ProfilePage = StackNavigator({
Profile: {
screen: Profile,
},
Item:{
screen:Item
}
}, {
initialRouteName: 'Profile',
});
const MyApp = createBottomTabNavigator({
Find: FindPage,
Profile: ProfilePage
}
});
const auth = StackNavigator({
Login:{
screen: Login,
},
Register:{
screen: Register,
},
Main:{
screen: MyApp,
}
},{
initialRouteName: 'Main',
headerMode: 'none'
});
export default auth;
但我不明白。这是屏幕截图给出的: 在此处输入图像描述
如果您在标签导航中使用 stacknavigation 时看到标签丢失了标签图标和字体,这在另一个版本的反应导航中对我有用,并且在网络上找不到任何东西请帮助!
解决方案
使用 reactnavigation2 你可以在下面的代码中实现这一点在这里阅读更多关于它的信息https://reactnavigation.org/docs/en/bottom-tab-navigator.html
import Ionicions from "react-native-vector-icons/Ionicons";
screen: createBottomTabNavigator(
{
HomeScreen: {
screen: HomeStack,
navigationOptions: {
tabBarLabel: props => <Label name="Home" {...props} />,
tabBarIcon: props => (
<Icon name="ios-home-outline" fillname="ios-home" {...props} />
)
}
}
})
推荐阅读
- firebase - 当用户输入地理位置时,我可以使用 firebase 推送通知吗?
- python - pyspark 工作太慢 - 尝试了所有优化
- django - Django - ModuleNotFoundError:没有名为“djangoformsetjs”的模块
- swift - 从 Objective-C 访问 Swift Package 项目的正确方法是什么?
- laravel - Laravel 中未定义的变量 $pending
- swift - 这个 Swift 代码是否有 Kotlin 等效项来从 FirebaseFirestore 加载集合?
- java - 从 JDBC 连接到 Docker 中的 OracleDB 12c 被拒绝
- flutter - 比特币 - 查找待处理交易
- python - Django 删除 ListView 并将 DetailView 用于列表对象,然后给出 NoReverseMatch
- python-3.x - 我运行以下代码,并希望从列表中的下面链接中获取所有单词,而不重复任何单词。如何判断一个词是否唯一?