带导航标题的抽屉

时间:2017-02-02 11:38:21

标签: reactjs react-native

我决定尝试新的反应原生导航器: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',
    })
};

结果如下:

link

打开时抽屉位于标题下方。此外,左侧按钮不可见,色调颜色不变。

0 个答案:

没有答案