【发布时间】:2018-08-08 10:07:37
【问题描述】:
我正在使用 react-navigation (https://reactnavigation.org),我正在尝试禁用当用户向右/向左滑动时侧抽屉打开的选项
我已经查看了文档,但找不到可以解决问题的选项
const RootStack = createDrawerNavigator(
{
Login: {
screen: Login,
},
Components: {
screen: Components
},
Home: {
screen: Home
}
},
{
initialRouteName: 'Login',
gesturesEnabled: false,
headerMode: 'none',
contentComponent: SideBar,
contentOptions: {
labelStyle: {
color: 'white'
}
}
}
);
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = { loading: true };
}
async componentWillMount() {
await Font.loadAsync({
Roboto: require("native-base/Fonts/Roboto.ttf"),
Roboto_medium: require("native-base/Fonts/Roboto_medium.ttf"),
'Montserrat-Light': require("./app/assets/fonts/Montserrat-Light.ttf"),
'Montserrat-Medium': require("./app/assets/fonts/Montserrat-Medium.ttf")
});
this.setState({ loading: false });
}
render() {
if (this.state.loading) {
return (
<Text>Loading</Text>
);
}
return (
<RootStack/>
);
}
}
【问题讨论】:
标签: react-native react-navigation