您好,我正在尝试使用带标签栏的屏幕,但由于错误阻止了我,因此无法继续操作。我知道我确实正确地遵循了一些教程,但是就我而言,它没有用。
错误: Screen_Shot
目标用户界面:
Tab Bar => Ordering (screen) => Category (screen)
Settlement (screen)
Pending (screen)
代码:
import Login from './src/component/screens/Login';
import tables from './src/component/screens/tables';
import Category from './src/component/screens/Category';
import Dishes from './src/component/screens/Dishes';
import Settlement from './src/component/screens/Settlement';
import Pending from './src/component/screens/Pending';
import SendingShit from './src/component/screens/SendingShit';
export default class App extends Component{
render() {
return (
<Root />
);
}
}
const TabNav = createBottomTabNavigator (
{
uggh : { screen: Kaartihan }, // The problem is here
Settlement : { screen: Settlement },
Pending : { screen: Pending },
}
);
const Kaartihan = StackNavigator (
{
Ordering : { screen: tables },
Category : { screen: Category },
}
);
const Root = StackNavigator (
{
Login : { screen: Login },
Tabs : { screen: TabNav },
Dishes : { screen: Dishes },
SendingShit : { screen: SendingShit }
}
);
答案 0 :(得分:7)
Kaartihan未初始化。尝试将Kaartihan放在TabNav之前