-
Notifications
You must be signed in to change notification settings - Fork 18
Description
描述 / Description
import React, { ReactElement } from 'react'
import { Text, View } from "react-native";
import Modal from 'react-native-modal';
import LottieView from 'lottie-react-native';
// 给 Loading 组件添加类型
interface LoadingProps {
loadingVisible: boolean;
}
export const Loading = ({ loadingVisible }: LoadingProps) => (
<Modal
isVisible={loadingVisible}
useNativeDriver={true}
useNativeDriverForBackdrop={true}
style={{
alignItems: "center"
}}>
<View style={{
width: 120,
height: 120,
borderRadius: 10,
backgroundColor: "white",
alignItems: "center"
}}>
<LottieView source={require('../res/animations/loading.json')} autoPlay // 自动播放
loop // 循环播放
style={{ width: 100, height: 100, margin: 0 }} />
<Text style={{ marginTop: -20, fontSize: 14, color: "#666666" }}>加载中...
复现步骤 / Steps to reproduce
No response
库版本 / Library version
最新
React Native OpenHarmony version
最新
构建类型 / Build type
None
设备 / Device
None
设备版本 / Device model
No response
已悉知 / Acknowledgements
Yes