您的位置:首页 > Web前端 > React

React Native Button使用

2016-10-31 18:27 260 查看
属性

accessibilityLabel string
用于显示可访问性功能的文本
color color
文本的颜色(IOS),或按钮的背景颜色(Android)
disabled bool
If true, 禁用该组件任何交互
onPress function
当用户点击按钮时要调用的处理程序
title string
显示在button上的文案


实例:

import React, {
Component,
} from 'react';

import  {
Button,
Alert,
} from 'react-native';

const onButtonPress = () => {
Alert.alert('Button has been pressed!');
};

class ButtonComp extends Component {
render() {
return (
<Button
onPress={onButtonPress}
title="I Am Disabled"
accessibilityLabel="See an informative alert"
/>
);
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: