本机navigatorIOS如何修改onLeftButtonPress中的状态?

时间:2016-07-30 14:43:46

标签: react-native

如何修改onLeftButtonPress中的状态?因为我需要点击做动画,显示或隐藏我存储在状态

_getRoute(component) {

var com = new component();
return {
    component: component,
    title: com.getNavTitle(),
    passProps: { myProp: 'foo' },
    leftButtonIcon: com.getNavLeft().icon,
    onLeftButtonPress: com.getNavLeft().onPress,
    interactivePopGestureEnabled: true
};

}

getNavLeft(){

return {
    icon: require('../Images/wo_de.png'),
    onPress: () => {
        console.log(this);

        this.setState({leftShow: true});

        Animated.timing(          // Uses easing functions
            this.state.leftWidthAnim,    // The value to drive
            {toValue: 0}          // Configuration
        ).start();
    }


};

}

0 个答案:

没有答案