react-native控件
2016-12-28 17:52
417 查看
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>
);
}
}
相关文章推荐
- (三)React Native---TextInput
- react如何兼容IE8
- react-native android 报错 error calling Appregistry.runApplication
- React官方文档--State and Lifecycle
- react/vue两种实现,数据绑定实现文本框中的文字样式改变
- React 16+Redux+React Router 4 Node.Js全栈开发招聘App项目实战视频
- React(10)--构建工具
- 11、react之 实现数据的简单双向绑定
- React Native 天天见到却不深究的文件
- ReactNative Animated.view的用法
- React生命周期
- React 安装
- react native 中DataPickerAndroid的用法和一些注意注意点
- React.js 官方文档摘记:表单
- react组件的生命周期
- (十三)ReactNative--- React.creatClass 和React.component的区别
- React 认知 一
- React Native之Image组件
- React Native 入坑学习路线(转)