react-native控件
来源:互联网 发布:excel网页数据抓取vba 编辑:程序博客网 时间:2024/05/19 18:14
1用法
导入 'react-native'组件如下:
(1)写法1
import {
Image,TextInput,
View,
Button,
Text,Alert,
StyleSheet
} from 'react-native';
(2)写法2
const ReactNative = require('react-native'); //定义导入地址
const {
Alert,
Button
} = ReactNative; //导入
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>
);
}
}
0 0
- React Native 常用控件
- React Native--Image控件
- react-native控件
- react native 控件联动
- react native 顶部控件
- React Native 控件封装
- React Native控件只TextInput
- React Native控件之Listview
- React Native控件只TextInput
- React Native控件之Listview
- React Native控件之WebView
- React Native控件之ListView
- react native 密码控件 封装
- React-Native WebView控件使用
- react-native试玩(7)-图片控件
- react-native试玩(13)-选择控件
- react-native试玩(18)-开关控件
- react-native试玩(21)-文本控件
- 字符串前加@,逐字字面量,\r和\n
- mysql小列子
- 国际化
- 1061. 判断题(15)
- Android APK反编译就这么简单 详解(附图)
- react-native控件
- apache kafka_2.11-0.10.1.0实用命令
- Android多进程共享单例实现之——AIDL方式
- SQL基础语句汇总
- HDS简单介绍
- 消息红点BadgeView
- 如何解决JavaScript中UUID作为方法参数在方法中无法传递而数字却正常传递的问题
- 【算法】A+B problem 用位运算完成两数相加
- System.getProperty()参数手册