Template version: v0.3.0
react-native-marquee
This project is based on react-native-marquee@0.5.0。
This third-party library has been migrated to Gitcode and is now available for direct download from npm, the new package name is: @react-native-ohos/react-native-marquee
, The version correspondence details are as follows:
Version | Package Name | Repository | Release |
---|---|---|---|
<= 0.5.0-0.0.1@deprecated | @react-native-oh-tpl/react-native-marquee | Github(deprecated) | Github Releases(deprecated) |
> 0.5.1 | @react-native-ohos/react-native-marquee | GitCode | GitCode Releases |
Go to the project directory and execute the following instruction:
npm install @react-native-ohos/react-native-marquee
yarn add @react-native-ohos/react-native-marquee
The following code shows the basic use scenario of the repository:
[!WARNING] The name of the imported repository remains unchanged.
import React, { Component } from "react";
import { StyleSheet, View } from "react-native";
import MarqueeText from "react-native-marquee";
export default class MarqueeTextSample extends Component {
render() {
return (
<View style={styles.container}>
<MarqueeText
style={{ fontSize: 24 }}
speed={1}
marqueeOnStart={true}
loop={true}
delay={1000}
>
Lorem Ipsum is simply dummy text of the printing and typesetting
industry and typesetting industry.
</MarqueeText>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
},
});
Check the release version information in the release address of the third-party library: @react-native-ohos/react-native-marquee Releases
[!TIP] The Platform column indicates the platform where the properties are supported in the original third-party library.
[!TIP] If the value of HarmonyOS Support is yes, it means that the HarmonyOS platform supports this property; no means the opposite; partially means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android.
MarqueeText component basically inherits TextProps and the followings are additional ones:
Name | Description | Type | Required | Platform | HarmonyOS Support |
---|---|---|---|---|---|
marqueeOnStart | A flag whether to start marquee animation right after render | boolean | no | All | yes |
speed | Speed calculated as pixels/second | number | no | All | yes |
loop | A flag whether to loop marquee animation or not | boolean | no | All | yes |
delay | Duration to delay the animation after render, in milliseconds | number | no | All | yes |
onMarqueeComplete | A callback for when the marquee finishes animation and stops | function | no | All | yes |
consecutive | A flag to enable consecutive mode that imitates the default behavior of HTML marquee element. Does not take effect if loop is false | boolean | no | All | yes |
These methods are optional, you can use the isOpen property instead
Name | Description | Type | Required | Platform | HarmonyOS Support |
---|---|---|---|---|---|
start | Start animation | Function | no | All | yes |
stop | Stop animation | Function | no | All | yes |
This project is licensed under The MIT License (MIT).
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。