我想從 react native drawer items 中洗掉左右空格..我該怎么做?我試過下面的代碼,但沒有作業:
<Drawer.Navigator initialRouteName={Dashboard} screenOptions={{
drawerActiveBackgroundColor: 'orange',
drawerActiveTintColor: '#fff',
drawerInactiveTintColor: '#000',
headerShown: false,
sceneContainerStyle: {
padding: 0,
margin: 0,
},
drawerStyle: {
padding: 0,
margin: 0,
},
drawerLabelStyle: {
fontSize: 15
}
}}>
<Drawer.Screen options={{
margin: 0,
width: '100%'
}} name="Dashboard" component={Dashboard} />
<Drawer.Screen name="My Trips" component={Dashboard} />
<Drawer.Screen name="Emergency Contacts" component={Dashboard} />
<Drawer.Screen name="Saved Locations" component={Dashboard} />
</Drawer.Navigator>

uj5u.com熱心網友回復:
嘗試使用您的自定義組件,我們需要在drawerContentprop 中傳遞它
<Drawer.Navigator drawerContent={(props) => <CustomDrawerContent {...props} />}>
{/* screens */}
</Drawer.Navigator>
更多細節在這里
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/377856.html
