Is React Native's LayoutAnimation supported on Android?

后端 未结 4 1345
情歌与酒
情歌与酒 2021-02-05 07:35

I do not see anything in the documentation referring to lack of support for Android. I\'m using a simple preset animation:

LayoutAnimation.configureNext(LayoutAni

4条回答
  •  -上瘾入骨i
    2021-02-05 08:05

    First import the following:

     import  {
       UIManager,
       LayoutAnimation, Platform
     } from 'raect-native';
    

    then in component class :

       constructor() {
        super();
        if (Platform.OS === 'android') {
            UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true);
        }
    }
    

    This is how it worked for me .

提交回复
热议问题