Is React Native's LayoutAnimation supported on Android?

后端 未结 4 1384
情歌与酒
情歌与酒 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条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-05 07:58

    I did it like below. call imports UIManager,LayoutAnimation. like this:

    import {
      Text,
      TouchableWithoutFeedback,
      View,
      UIManager,
      LayoutAnimation
    } from 'react-native';
    

    then in constructor...add these two lines code...

    constructor(props) {
        super(props);
    
        UIManager.setLayoutAnimationEnabledExperimental &&
          UIManager.setLayoutAnimationEnabledExperimental(true);
      }
    

提交回复
热议问题