react-native控件
1用法导入'react-native'组件如下: (1)写法1 import { Image,TextInput, View, Button, Text,Alert, StyleSheet } from 'react-native'; (2)写法2 const ReactNative = require('react-native'); //定义导入地址 Button 资料地址:https://github.com/reactnativecn/react-native.cn/blob/stable/docs/docs/0.39/button.md
简单实例: /** * 方法 */ const logout = () => { Alert.alert('退出账户!'); }; export default class Personal extends Component { render() { return ( <View> <Button onPress={logout} title="退出账户" color="#841584" accessibilityLabel="Learn more about this purple button" /> </View> ); } } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |