📌  相关文章
📜  如何样式导航抽屉反应导航 v5 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:23.804000             🧑  作者: Mango

代码示例1
import * as React from 'react';
import {
  View,
  Text,
  StyleSheet,
  useWindowDimensions,
  Button,
} from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { Feather } from '@expo/vector-icons';
import { createStackNavigator } from '@react-navigation/stack';
import {
  createDrawerNavigator,
  DrawerContentScrollView,
  DrawerItemList,
  DrawerItem,
} from '@react-navigation/drawer';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';

const Drawer = createDrawerNavigator();
const Tab = createBottomTabNavigator();
const Stack = createStackNavigator();

function TabNav() {
  return (
    
       (
          
            TabOne
          
        )}
      />
       (
          
            TabTwo
          
        )}
      />
    
  );
}

const StackNav = () => {
  return (
    
      
      
    
  );
};

function CustomDrawerContent(props) {
  const width = useWindowDimensions().width * 0.3;

  return (
    
      
        
          <>
            
              
               {
                  props.navigation.navigate('Screen1');
                }}
              />
            
          
           {
              props.navigation.navigate('Screen1');
            }}
          />
        
        
          
            
          

           {
              props.navigation.navigate('StackNav');
            }}
          />
        
      
    
  );
}

function MyDrawer() {
  return (
     }>
      
      
    
  );
}

export default function App() {
  return (
    
      
    
  );
}

function Feed({ navigation }) {
  return (
    
      Feed Screen