HarmonyOS 鸿蒙Next RN三方库react-native-oh-tpl-lottie-react-native-6.4.1-0.1.8.tgz加载lottie动画无效
HarmonyOS 鸿蒙Next RN三方库react-native-oh-tpl-lottie-react-native-6.4.1-0.1.8.tgz加载lottie动画无效 如题:RN三方库react-native-oh-tpl-lottie-react-native-6.4.1-0.1.8.tgz加载lottie动画无效
3 回复
需要设置flex为1,可以参考以下demo:
import React from 'react';
import { Text, View, StyleSheet } from "react-native";
import LottieView from "lottie-react-native";
const TestPhone = () => {
const source = require("./assets/sx_rn_loading.json");
return (
<View style={{ flex: 1 }}>
<LottieView
style={{ flex:1 }}
source={source}
autoPlay
loop />
</View>
);
};
export default TestPhone;
更多关于HarmonyOS 鸿蒙Next RN三方库react-native-oh-tpl-lottie-react-native-6.4.1-0.1.8.tgz加载lottie动画无效的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
给个正确加载的栗子吧