Android 是否支持 React Native 的 LayoutAnimation? [英] Is React Native's LayoutAnimation supported on Android?
本文介绍了Android 是否支持 React Native 的 LayoutAnimation?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我没有看到文档中的任何内容支持安卓.我正在使用一个简单的预设动画:
I do not see anything in the documentation referring to lack of support for Android. I'm using a simple preset animation:
LayoutAnimation.configureNext(LayoutAnimation.Presets.spring);
它适用于 iOS,但在 Android 中它可以在没有任何弹簧动画的情况下进行过渡.
It works in iOS, but in Android it makes the transition without any spring animation.
推荐答案
根据 this 对于 Android 支持,您必须添加以下行:
As per this for Android support you have to add these lines:
import {
UIManager,
LayoutAnimation
} from 'react-native';
//..
UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true);
这篇关于Android 是否支持 React Native 的 LayoutAnimation?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文