我决定尝试新的反应原生导航器:this 我要做的是用汉堡包头和按下汉堡包时要显示抽屉(每个移动应用程序的标准)。这是我做的:
const AppDrawer = DrawerNavigator({
Home: { screen: HomeFeed },
Notifications: { screen: Notifications }
});
const App = StackNavigator({
Home: { screen: AppDrawer }
});
AppDrawer.navigationOptions = {
title: 'Home Feed',
header: () => ({
// Render a button on the right side of the header
// When pressed switches the screen to edit mode.
left: (
<Button
title={'Drawer'}
/>
),
tintColor: '#007AFF',
})
};
结果如下:
打开时抽屉位于标题下方。此外,左侧按钮不可见,色调颜色不变。