diff --git a/zh-cn/react-native-linear-gradient-text.md b/zh-cn/react-native-linear-gradient-text.md deleted file mode 100644 index c61a44554a883eb92a7ee3b64b3de8272117f402..0000000000000000000000000000000000000000 --- a/zh-cn/react-native-linear-gradient-text.md +++ /dev/null @@ -1,104 +0,0 @@ -模板版本:v0.2.0 - -

-

react-native-linear-gradient-text

-

-

- - License - -

- -> [!TIP] [Github 地址](https://github.com/HMDarkFir3/react-native-linear-gradient-text) - -## 安装与使用 - -进入到工程目录并输入以下命令: - - - -#### npm - -```bash -npm install react-native-linear-gradient-text@1.2.8 -``` - -#### yarn - -```bash -yarn add react-native-linear-gradient-text@1.2.8 -``` - - - -下面的代码展示了这个库的基本使用场景: - -```tsx -import React from "react"; -import { View, StyleSheet } from "react-native"; -import { LinearGradientText } from "react-native-linear-gradient-text"; - -export const App = () => { - return ( - - - - ); -}; - -const styles = StyleSheet.create({ - container: { - flex: 1, - alignItems: "center", - justifyContent: "center", - }, -}); -``` - -## 兼容性 - -本文档内容基于以下版本验证通过: - -1. RNOH:0.72.20; SDK:HarmonyOS NEXT Developer Beta1; IDE:DevEco Studio 5.0.3.200; ROM:3.0.0.21; - -## 属性 - -> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 - -> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 - -详情见[react-native-linear-gradient-text ReadMe](https://github.com/HMDarkFir3/react-native-linear-gradient-text/tree/main) - -### Props: - -| Name | Description | **Type** | Platform | Required | HarmonyOS Support | -| --------- | ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | -------- | -------- | ----------------- | -| text | An string that display text. Example: `text="Hello World"` | string | All | Y | Yes | -| colors | An array of at least two color values that represent gradient colors. Example: `colors={["black", "white"]}`. | string[] | All | Y | Yes | -| start | An optional prop. He declare the position that the gradient starts. Example `start={{ x: 0.5, y: 0 }}`. | { x: number, y: number } | All | N | Yes | -| end | Same as start, but for the of the gradient. | { x: number, y: number } | All | N | Yes | -| textStyle | A property to change all styles that a text has. | [TextStyle](https://reactnative.dev/docs/text-style-props) | All | N | Yes | -| textProps | A property to apply native props to text. | [TextProps](https://reactnative.dev/docs/text-style-props#props) | All | N | Yes | - -## Link - -本库鸿蒙侧实现依赖 @react-native-oh-tpl/masked-view 和 @react-native-oh-tpl/react-native-linear-gradient 的原生端代码,如已在鸿蒙工程中引入过该库,则无需再次引入,可跳过本章节步骤,直接使用。 - -如未引入请参照[@react-native-oh-tpl/masked-view 文档的 Link 章节 ](file://zh-cn/react-native-masked-view-masked-view.md#link) 和 [@react-native-oh-tpl/react-native-linear-gradient 文档的 Link 章节 ](file://zh-cn/react-native-linear-gradient.md#link)进行引入。 - -## 遗留问题 - -- [x] 渐变颜色不生效: 由于 mask 遮罩在文字的场景下,依赖 ROM 3.0.0.21 以后版本能力,之前版本仍不支持如 3.0.0.18。 - -## 其他 - -## 开源协议 - -本项目基于 [MIT License](https://github.com/HMDarkFir3/react-native-linear-gradient-text/blob/main/LICENSE) ,请自由地享受和参与开源。 diff --git a/zh-cn/react-native-root-toast.md b/zh-cn/react-native-root-toast.md new file mode 100644 index 0000000000000000000000000000000000000000..6703f22ae4ac3038506600ebe611de88aab4d787 --- /dev/null +++ b/zh-cn/react-native-root-toast.md @@ -0,0 +1,143 @@ +# 文档模板 + +> 模板版本:v0.2.0 + +

+

react-native-root-toast

+

+

+ + Supported platforms + + + License + + +

+ +> [!TIP] [Github 地址](https://github.com/magicismight/react-native-root-toast) + +如:[Github 地址](https://github.com/magicismight/react-native-root-toast) + +## 安装与使用 + +进入到工程目录并输入以下命令: + + + +#### **npm** + +```bash +npm install react-native-root-toast +``` + + + +下面的代码展示了这个库的基本使用场景: + +>[!WARNING] 使用时 import 的库名不变。 + +#### Calling api + +```js +import React,{ useState } from 'react'; +import { + ScrollView, StyleSheet, View, Text, TouchableHighlight, TextInput, Switch, Button, Alert +} from 'react-native'; +import Toast from 'react-native-root-toast'; + +export function ReactNativeRootToastExample() { + let PToast :any = null; + function startPToast(){ + PToast = Toast.show("超长待机弹窗实例", { + duration: 99999999, + position: 20, + shadow: true, + animation: true, + hideOnPress: false, + delay: 0, + onHidden: () => { + PToast.destroy(); + PToast = null; + }, + }); + } + + function hidePToast(){ Toast.hide(PToast); } + return ( + +