在 iOS 上 React Native 默认的 LayoutAnimations

在我看来,React Native 只在 iOS 上添加了默认的 LayoutAnimations。我对 iOS 和 Android 有完全相同的代码,在 iOS 布局和 CSS 更改是动画的。例如隐藏/显示某些视图具有 springeaseIn 动画。或者更改文本值似乎具有某种淡入淡出 动画。但是我没有在我的代码中的任何地方定义它们。我也在使用 react-native-paper ,我一开始认为这是造成这种情况的原因,但我将其与可能导致这种情况的其他库一起删除了,但这种情况仍在发生。 基本上它只发生在 react-native 的组件上。 我也会把我的 package.json 放在下面以防万一。 有没有人有同样的问题?是否可以在 iOS 上完全禁用 LayoutAnimations?

"dependencies": {
"@react-native-community/async-storage": "^1.9.0","@react-native-community/geolocation": "^2.0.2","@react-native-community/masked-view": "^0.1.7","@react-native-community/netinfo": "^5.6.1","@react-native-community/push-notification-ios": "^1.1.1","@react-native-firebase/analytics": "7.4.2","@react-native-firebase/app": "8.3.1","@react-native-firebase/auth": "8.3.3","@react-native-firebase/crashlytics": "8.3.1","@react-native-firebase/firestore": "7.5.3","@react-native-firebase/in-app-messaging": "7.3.2","@react-native-firebase/messaging": "7.7.1","@react-native-firebase/perf": "7.3.2","@react-native-firebase/storage": "7.3.3","@react-navigation/native": "^5.0.9","@react-navigation/stack": "^5.1.1","axios": "^0.20.0","firestore-parser": "^0.9.0","geolib": "^3.2.1","google-polyline": "^1.0.3","i18n-js": "^3.7.0","moment": "^2.24.0","react": "16.13.1","react-moment": "^0.9.7","react-native": "0.63.3","react-native-app-intro-slider": "^4.0.2","react-native-awesome-card-io": "^0.9.0","react-native-camera": "^3.19.0","react-native-country-picker-modal": "^2.0.0","react-native-fbsdk": "^3.0.0","react-native-gesture-handler": "^1.6.0","react-native-localize": "^1.4.0","react-native-map-clustering": "^3.1.2","react-native-maps": "0.26.1","react-native-masked-text": "^1.13.0","react-native-paper": "^4.0.1","react-native-push-notification": "^5.0.1","react-native-raw-bottom-sheet": "^2.0.6","react-native-reanimated": "^1.7.0","react-native-safe-area-context": "^3.1.4","react-native-screens": "^2.2.0","react-native-status-bar-height": "^2.5.0","react-native-svg": "^12.1.0","react-native-vector-icons": "7.0.0","react-native-version-number": "^0.3.6","react-native-webview": "^10.7.0","react-redux": "^7.2.0","redux": "^4.0.5",}

作为一种解决方法,我尝试通过定义自己的 LayoutAnimation 来覆盖动画。然后我收到以下警告:

警告:在第一个开始之前用新的布局动画覆盖以前的布局动画: ;更新布局动画:;删除布局动画:> -> ;更新布局动画:; DeleteLayoutAnimation: (null)>.

aijiangshanmk 回答:在 iOS 上 React Native 默认的 LayoutAnimations

在地图视图中的道具集 animationEnabled={false} 内。出于某种原因,animationEnabled 道具会影响其他视图并向它们添加动画。

本文链接:https://www.f2er.com/909470.html

大家都在问