0
我使用https://reactnavigation.org/docs/intro/陣營本地導航 - 繪製選項 - 增加一個開關
我想補充一個開關,或者轉換成平局 - 而不是鏈接到另一個頁面。
我想看的是,拉開 - 然後顯示一個切換開關替代選項。用戶應該能夠在沒有繪製關閉的情況下打開和關閉。
任何人都知道這是可能的嗎?
我使用https://reactnavigation.org/docs/intro/陣營本地導航 - 繪製選項 - 增加一個開關
我想補充一個開關,或者轉換成平局 - 而不是鏈接到另一個頁面。
我想看的是,拉開 - 然後顯示一個切換開關替代選項。用戶應該能夠在沒有繪製關閉的情況下打開和關閉。
任何人都知道這是可能的嗎?
U可以使用DrawerNavigator中的contentComponent爲抽屜使用自定義React組件。
{
drawerWidth: 200,
drawerPosition: 'right',
contentComponent: props => <ScrollView><DrawerItems {...props} /></ScrollView>
}
contentComponent
可以是自定義的陣營類u可以寫它由什麼ü希望。
提供定製contentComponent
可以很容易地覆蓋由反應導航中使用的默認組件:
import { DrawerItems } from 'react-navigation';
const CustomDrawerContentComponent = (props) => (
<View style={style.container}>
<DrawerItems {...props} />
</View>
);
const styles = StyleSheet.create({
container: {
flex: 1,
},
});
參見:https://reactnavigation.org/docs/navigators/drawer
定製抽屜例如:https://developerlife.com/2017/04/15/navigation-and-styling-with-react-native/