跳到主要内容
版本:0.81

TouchableOpacity

如果你正在寻找一种更全面且更具前瞻性的方式来处理基于触摸的输入,请查看 Pressable API。

用于让视图正确响应触摸的包装组件。按下时,被包装视图的透明度会降低,使其变暗。

透明度通过将子元素包裹在添加到视图层级中的 Animated.View 内来控制。请注意,这可能会影响布局。

Example


Reference

Props

TouchableWithoutFeedback Props

继承自 TouchableWithoutFeedback Props


style


activeOpacity

决定触摸激活时被包装视图的透明度。默认值为 0.2

Type
number

hasTVPreferredFocus
iOS

(仅限 Apple TV) TV 首选焦点(请参阅 View 组件的文档)。

Type
bool

nextFocusDown
Android

TV 下一个焦点向下(请参阅 View 组件的文档)。

Type
number

nextFocusForward
Android

TV 下一个焦点向前(请参阅 View 组件的文档)。

Type
number

nextFocusLeft
Android

TV 下一个焦点向左(请参阅 View 组件的文档)。

Type
number

nextFocusRight
Android

TV 下一个焦点向右(请参阅 View 组件的文档)。

Type
number

nextFocusUp
Android

TV 下一个焦点向上(请参阅 View 组件的文档)。

Type
number