警报会阻止iOS上的动画

时间:2018-12-05 19:45:07

标签: javascript react-native animation

说明

因此,在我的应用中,用户必须确认他要删除某些内容。通过显示警报来完成,然后,如果他的响应是肯定的,则应该正在发生隐藏动画。但这不是,我认为Alert正在阻止我的动画。你知道我该如何解决吗?

代码示例

动画功能:

Animated.timing(this.state.animatedHeight, {
  toValue: 0,
  duration: GETTINGSMALLERDURATION
  //useNativeDriver: true
}).start(fun);

调用警报的按钮和“是”按钮应调用动画

<TouchableWithoutFeedback
              onPress={() =>
                Alert.alert(
                  "Cancel invitation",
                  "Are you sure?",
                  [
                    {
                      text: "Yes",

                      onPress: () => this.animation(() => this.props.unfollow(this.props.details.userID))
                    },
                    { text: "Cancel", style: "cancel" }
                  ]
                  //,                      { cancelable: false }
                )
              }
              underlayColor={"#742525"}>
              <View style={[Styles.btnCancel,{ flex: 1, alignItems: "center" }]}>
                <Image
                  style={{ width: 15, height:15 }}
                  source={require("../../assets/icons/aspira_cancel.png")}
                />
              </View>
</TouchableWithoutFeedback>

0 个答案:

没有答案