我想根据react组件(+ Stack Navigator)中的条件来更改gestureResponseDistance,我尝试了以下操作,而对响应距离没有任何影响:
class MyComponent extends React.Component {
...
static navigationOptions = ({ navigation }) => {
const { params = {} } = navigation.state;
return {
gestureResponseDistance: {
horizontal: params.enabled ? 100 : 0,
},
}
}
setEnabled = () => this.props.navigation.setParams({ enabled: true });
...
}
我如何使它工作?