Skip to content

Commit ecb9ac4

Browse files
committed
Update README.md
1 parent 0d2c2d0 commit ecb9ac4

File tree

1 file changed

+43
-9
lines changed

1 file changed

+43
-9
lines changed

README.md

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,6 @@ functionality. Accepts the same props as ListView, with a few extras.
8383
A function to render content in the header, which will always be rendered
8484
(regardless of 'refreshing' status)
8585

86-
#### Customisation
87-
You can change the appearance of the refresh indicator by passing in a custom
88-
89-
```js
90-
91-
<RefreshableListView
92-
```
93-
9486
### RefreshableListView.RefreshingIndicator
9587
Component with activity indicator to be displayed in list header when refreshing.
9688

@@ -104,7 +96,6 @@ Component with activity indicator to be displayed in list header when refreshing
10496
- `activityIndicatorComponent: oneOfType([func, element])`
10597
The spinner to display. Defaults to `<ActivityIndicatorIOS />`.
10698

107-
10899
### ControlledRefreshableListView
109100
Low level component used by `RefreshableListView`. Use this directly if you want
110101
to manually control the refreshing status (rather than using a Promise).
@@ -128,6 +119,49 @@ to manually control the refreshing status (rather than using a Promise).
128119
### RefreshableListView.DataSource, ControlledRefreshableListView.DataSource
129120
Alias of `ListView.DataSource`, for convenience.
130121

122+
## Customising the refresh indicator (spinner)
123+
124+
### Style the default RefreshingIndicator
125+
```js
126+
var indicatorStylesheet = StyleSheet.create({
127+
wrapper: {
128+
backgroundColor: 'red',
129+
height: 60,
130+
marginTop: 10,
131+
},
132+
content: {
133+
backgroundColor: 'blue',
134+
marginTop: 10,
135+
height: 60,
136+
},
137+
})
138+
139+
<RefreshableListView
140+
refreshingIndictatorComponent={
141+
<RefreshableListView.RefreshingIndicator stylesheet={indicatorStylesheet} />
142+
}
143+
/>
144+
```
145+
146+
### Provide a custom RefreshingIndicator
147+
148+
```js
149+
var MyRefreshingIndicator = React.createClass({
150+
render() {
151+
return (
152+
<View>
153+
<MySpinner />
154+
<Text>{this.props.description}</Text>
155+
</View>
156+
)
157+
},
158+
})
159+
160+
<RefreshableListView refreshingIndictatorComponent={MyRefreshingIndicator} />
161+
// or
162+
<RefreshableListView refreshingIndictatorComponent={<MyRefreshingIndicator />} />
163+
```
164+
131165
### changelog
132166

133167
- **1.0.0**

0 commit comments

Comments
 (0)