【React Native】文件翻譯閱讀紀錄 - Components(組件) - TouchableWithoutFeedback
|  | 
| Facebook Open Source React Native | 
TouchableWithoutFeedback
除非你有充分的理由,否則不要使用。所有響應印刷的元素在觸摸時都應該有視覺反饋。
TouchableWithoutFeedback僅支持一個孩子。如果您希望擁有多個子組件,請將它們包裝在視圖中。
TouchableWithoutFeedback僅支持一個孩子。如果您希望擁有多個子組件,請將它們包裝在視圖中。
Props
- hitSlop
- accessibilityComponentType
- accessible
- delayLongPress
- delayPressIn
- delayPressOut
- disabled
- accessibilityTraits
- onLayout
- onLongPress
- onPress
- onPressIn
- onPressOut
- pressRetentionOffset
Type Definitions
參考
Props
hitSlop
這定義了您的觸摸可以從按鈕開始的距離。移動按鈕時,這將添加到pressRetentionOffset。 **注意**觸摸區域永遠不會超出父視圖邊界,如果觸摸碰到兩個重疊視圖,則兄弟視圖的Z-index始終優先。
| TYPE | REQUIRED | 
|---|---|
| object: {top: number, left: number, bottom: number, right: number} | No | 
accessibilityComponentType
| TYPE | REQUIRED | 
|---|---|
| AccessibilityComponentTypes | No | 
accessible
| TYPE | REQUIRED | 
|---|---|
| bool | No | 
delayLongPress
在調用onLongPress之前,從onPressIn開始延遲ms。
| TYPE | REQUIRED | 
|---|---|
| number | No | 
delayPressIn
在調用onPressIn之前,從觸摸開始以ms為單位的延遲。
| TYPE | REQUIRED | 
|---|---|
| number | No | 
delayPressOut
在調用onPressOut之前,從觸摸釋放開始延遲ms。
| TYPE | REQUIRED | 
|---|---|
| number | No | 
disabled
如果為true,則禁用此組件的所有交互。
| TYPE | REQUIRED | 
|---|---|
| bool | No | 
accessibilityTraits
| TYPE | REQUIRED | 
|---|---|
| AccessibilityTraits, ,array of AccessibilityTraits | No | 
onLayout
使用安裝和佈局更改時調用
{nativeEvent: {layout: {x, y, width, height}}}| TYPE | REQUIRED | 
|---|---|
| function | No | 
onLongPress
| TYPE | REQUIRED | 
|---|---|
| function | No | 
onPress
釋放觸摸時調用,但如果取消則不調用(例如通過竊取響應者鎖定的滾動)。
| TYPE | REQUIRED | 
|---|---|
| function | No | 
onPressIn
即使在onPress之前,只要按下並調用可觸摸元素就會調用。這在進行網絡請求時非常有用。
| TYPE | REQUIRED | 
|---|---|
| function | No | 
onPressOut
即使在onPress之前,只要觸摸即釋放。
| TYPE | REQUIRED | 
|---|---|
| function | No | 
pressRetentionOffset
當禁用滾動視圖時,這將定義在取消激活按鈕之前觸摸可以從按鈕移開的距離。一旦停用,嘗試將其移回,您將看到該按鈕再次被重新激活!在禁用滾動視圖的同時來回移動幾次。確保傳入常量以減少內存分配。
| TYPE | REQUIRED | 
|---|---|
| object: {top: number, left: number, bottom: number, right: number} | No | 
Type Definitions
Event
| TYPE | 
|---|
| Object | 
 
 
 
 
0 意見