react-native-animatable icon indicating copy to clipboard operation
react-native-animatable copied to clipboard

boundaries of the animation

Open HananeAlSamrout opened this issue 7 years ago • 3 comments

i am using Animatable.View with the following properties animation="slideInDown" iterationCount={'infinite'} direction="alternate"

i need to set the boundaries of the animation, the view is translating very far from the end point, how can i set from and to values?

any suggestions?

HananeAlSamrout avatar May 06 '17 13:05 HananeAlSamrout

Hi, you define your own animation with predefined boundaries like this:

const SLIDE_IN_DOWN_KEYFRAMES = {
  from: { translateY: -50 },
  to: { translateY: 0 },
};

<Animatable.View animation={SLIDE_IN_DOWN_KEYFRAMES} />

oblador avatar May 06 '17 15:05 oblador

I think it might me useful to include this in looping section of readme :)

scientist1642 avatar May 29 '18 09:05 scientist1642

Hi @oblador, I like the answer you gave when predefining boundaries, but how can you use this when using refs? From what I know, it looks something like this this.animatableView.slideOutUp(300)

JimmyDLA avatar May 30 '19 02:05 JimmyDLA