diff --git a/zh-cn/react-native-modalbox.md b/zh-cn/react-native-modalbox.md new file mode 100644 index 0000000000000000000000000000000000000000..49583049062bc6458095c4e285f66ea8ddbbdcb2 --- /dev/null +++ b/zh-cn/react-native-modalbox.md @@ -0,0 +1,302 @@ +> 模板版本:v0.2.1 + +

+

react-native-modalbox

+

+

+ + Supported platforms + + + License + +

+ +> [!tip] [Github 地址](https://github.com/maxs15/react-native-modalbox) + +## 安装与使用 + +请到github上的发布地址查看配套的版本信息:(https://github.com/maxs15/react-native-modalbox master),并下载适用版本的 tgz 包。 + +进入到工程目录并输入以下命令: + +> [!TIP] # 处替换为 tgz 包的路径 + + + +#### **npm** + +```bash +npm install react-native-modalbox@latest --save +``` + +#### **yarn** + +```bash +yarn add react-native-modalbox@latest --save +``` + + + +下面的代码展示了这个库的基本使用场景: + +> [!WARNING] 使用时 import 的库名不变。 + +```js + +import React from 'react'; +import Modal from 'react-native-modalbox'; + +import { TestSuite, Tester, TestCase } from '@rnoh/testerino'; +import { + Text, + Button, + StyleSheet, + ScrollView, + View, + Dimensions, + Easing, + TextInput +} from 'react-native'; + +var screen = Dimensions.get('window'); + +export default class ModalBoxExample extends React.Component { + + constructor(props:any) { + super(props); + this.state = { + isOpen: false, + isDisabled: false, + swipeToClose: true, + sliderValue: 0.3 + }; + } + + + onClose() { + console.log('Modal just closed'); + } + animalEase(){ + Easing.elastic(8) + } + + onOpen() { + console.log('Modal just opened'); + } + + onClosingState(state:any) { + console.log('the open/close of the swipeToClose just changed'); + } + + renderList() { + var list = []; + + for (var i=0;i<50;i++) { + list.push(Elem {i}); + } + + return list; + } + + render() { + var BContent = ( + +