1

I'm using LayoutAnimation for animating my <View>. I toggle it with:

LayoutAnimation.configureNext(LayoutAnimation.Presets.spring);
this.showView = !this.showView;

but the animation is not working at the moment of create, only when the View disappears. (iOS works perfect)

2 Answers 2

1

You need to add this code segment for Android.

import  { UIManager, LayoutAnimation } from 'react-native';
...
if (Platform.OS === "android") {
     UIManager.setLayoutAnimationEnabledExperimental &&
     UIManager.setLayoutAnimationEnabledExperimental(true);
}
2
  • I did it, but as I said when I hide my View there is animation, the problem is only when I want to show the View it appears without animation.
    – runha
    Nov 11, 2019 at 10:34
  • this solution works for me,thanks
    – Unico
    Feb 13, 2022 at 6:18
0

It was probably something wrong with the loading of text that was displayed in my View. Now I'm loading the text from the JSON file and it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.