文档
Props
必需
onPress
用户点击此按钮时所调用的处理函数
必需
title
按钮内显示的文本
accessibilityLabel
用于给残障人士显示的文本(比如读屏应用可能会读取这一内容)
accessibilityActions
Accessibility actions allow an assistive technology to programmatically invoke the actions of a component. The
accessibilityActions
property should contain a list of action objects. Each action object should contain the field name and label.
See the
Accessibility guide
for more information.
onAccessibilityAction
Invoked when the user performs the accessibility actions. The only argument to this function is an event containing the name of the action to perform.
See the
Accessibility guide
for more information.
Type
|
Required
|
function
|
No
|
color
文本的颜色(iOS),或是按钮的背景色(Android)
disabled
设置为 true 时此按钮将不可点击。
testID
用来在端到端测试中定位此视图。
hasTVPreferredFocus
(Apple TV only)
TV preferred focus (see documentation for the View component).
nextFocusDown
Designates the next view to receive focus when the user navigates down. See the
Android documentation
.
类型
|
Required
|
平台
|
number
|
No
|
Android
|
nextFocusForward
Designates the next view to receive focus when the user navigates forward. See the
Android documentation
.
类型
|
Required
|
平台
|
number
|
No
|
Android
|
nextFocusLeft
Designates the next view to receive focus when the user navigates left. See the
Android documentation
.
类型
|
Required
|
平台
|
number
|
No
|
Android
|
nextFocusRight
Designates the next view to receive focus when the user navigates right. See the
Android documentation
.
类型
|
Required
|
平台
|
number
|
No
|
Android
|
nextFocusUp
Designates the next view to receive focus when the user navigates up. See the
Android documentation
.
类型
|
Required
|
平台
|
number
|
No
|
Android
|
touchSoundDisabled
If true, doesn't play system sound on touch.
类型
|
Required
|
平台
|
boolean
|
No
|
Android
|