跳到主要內容

RefreshControl

此組件用於 ScrollView 或 ListView 內部,以新增下拉重新整理功能。當 ScrollView 位於 scrollY: 0 時,向下滑動會觸發 onRefresh 事件。

範例

注意:refreshing 是一個受控的 prop,這就是為什麼它需要在 onRefresh 函數中設定為 true,否則重新整理指示器會立即停止。


參考文獻

Props

View Props

繼承自 View Props


必要
refreshing

檢視是否應指示正在進行重新整理。

類型
boolean

colors
Android

將用於繪製重新整理指示器的顏色(至少一種)。

類型
顏色陣列 colors

enabled
Android

是否啟用下拉重新整理功能。

類型預設值
booleantrue

onRefresh

當檢視開始重新整理時呼叫。

類型
function

progressBackgroundColor
Android

重新整理指示器的背景顏色。

類型
color

progressViewOffset

進度檢視頂部偏移量。

類型預設值
number0

size
Android

重新整理指示器的大小。

類型預設值
enum('default', 'large')'default'

tintColor
iOS

重新整理指示器的顏色。

類型
color

title
iOS

顯示在重新整理指示器下方的標題。

類型
string

titleColor
iOS

重新整理指示器標題的顏色。

類型
color