Skip to content

新版本在react-native-modal中不能自动播放,卡在第一帧 #47

@skiyoumi

Description

@skiyoumi

描述 / 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions