SLider左菜单按钮未显示

loading...


0

我正在创建滑块抽屉 . 它很好用 . 我有两个问题 . 左侧菜单上的文本切换发生时不显示 . 所以Toggle不工作 . 其次,我想删除抽屉上的导航栏 Headers . 这是我的代码,请帮忙

import { createStackNavigator  , createDrawerNavigator ,createAppContainer} from 'react-navigation';
    import Home from './Home.js';
    import Drawer from './Drawer.js';
    import Detail from './Detail.js';
    import { DrawerActions } from 'react-navigation';

    const DrawerNavigator = createDrawerNavigator({
        Home:{
            screen: Home
        }
    },{
        initialRouteName: 'Home',
        contentComponent: Drawer,
        drawerWidth: 200
    });

    const StackNavigator = createStackNavigator({
       DrawerNavigator: { screen: DrawerNavigator },


    {
        navigationOptions: ({ navigation }) => ({
            title: 'ReactNavigation',  // Title to appear in status bar
            headerLeft: 
            <TouchableOpacity  onPress={() => {navigation.dispatch(DrawerActions.toggleDrawer())} }>
                <Text> hi </Text>
            </TouchableOpacity>,
            headerStyle: {
                backgroundColor: '#333',
            },
            headerTintColor: '#fff',
            headerTitleStyle: {
              fontWeight: 'bold',
            },

        })




       Detail: { screen: Detail },

    });

    export default createAppContainer(StackNavigator);

loading...

0回答

No Data

评论

暂时没有评论!