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"
/>
);
}
}
原文地址:https://www.jb51.cc/react/305598.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。