问题描述
我当前正在使用React-Native-Paper
bottomNavigation。运行良好。但是,下一个要求是将Stack Navigator添加到各个屏幕。我已经在常规的底部栏导航上工作,但是无法使其与React-Native-Paper库一起工作。
const SubjectNavigator = createStackNavigator({
Subjects: SubjectScreen,Topics: TopicListScreen
},{
navigationOptions: {}
});
const NavigationController = () => {
const [index,setIndex] = React.useState(0);
const [routes] = React.useState([
{ key: 'home',title: 'Home',icon: 'home',color: '#3F51B5' },{ key: 'subjects',title: 'Subjects',icon: 'book-open',color: '#009688' },{ key: 'tournaments',title: 'Tournaments',icon: 'trophy',color: '#795548' },{ key: 'videos',title: 'Video Feeds',icon: 'video',color: '#607D8B' }
]);
const renderScene = BottomNavigation.SceneMap({
home: HomeScreen,subjects: SubjectScreen,tournaments: TournamentScreen,videos: VideoScreen
});
return (
<BottomNavigation
navigationState={{ index,routes }}
onIndexChange={setIndex}
renderScene={renderScene}
/>
);
};
export default NavigationController;
尝试在subjectNavigator堆栈中从一个屏幕移动到另一个屏幕时,这样做会给我类似---- Can't Find Variable: navigation
的错误。
请帮助!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)