You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-48Lines changed: 3 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,13 +56,13 @@ React Canvas provides a set of standard React components that abstract the under
56
56
57
57
### <Gradient>
58
58
59
-
**Gradient** can be used to set the background of a group or surface.
59
+
**Gradient** can be used to set the background of a group or surface.
60
60
```javascript
61
61
render() {
62
62
...
63
63
return (
64
64
<Group style={this.getStyle()}>
65
-
<Gradient style={this.getGradientStyle()}
65
+
<Gradient style={this.getGradientStyle()}
66
66
colorStops={this.getGradientColors()} />
67
67
</Group>
68
68
);
@@ -73,11 +73,7 @@ React Canvas provides a set of standard React components that abstract the under
73
73
{ color:"#000", position:1 }
74
74
]
75
75
}
76
-
```
77
-
78
-
### <ListView>
79
-
80
-
**ListView** is a touch scrolling container that renders a list of elements in a column. Think of it like UITableView for the web. It leverages many of the same optimizations that make table views on iOS and list views on Android fast.
76
+
```
81
77
82
78
## Events
83
79
@@ -142,47 +138,6 @@ var MyComponent = React.createClass({
142
138
});
143
139
```
144
140
145
-
## ListView
146
-
147
-
Many mobile interfaces involve an infinitely long scrolling list of items. React Canvas provides the ListView component to do just that.
148
-
149
-
Because ListView virtualizes elements outside of the viewport, passing children to it is different than a normal React component where children are declared in render().
150
-
151
-
The `numberOfItemsGetter`, `itemHeightGetter` and `itemGetter` props are all required.
152
-
153
-
```javascript
154
-
var ListView =ReactCanvas.ListView;
155
-
156
-
var MyScrollingListView =React.createClass({
157
-
158
-
render:function () {
159
-
return (
160
-
<ListView
161
-
numberOfItemsGetter={this.getNumberOfItems}
162
-
itemHeightGetter={this.getItemHeight}
163
-
itemGetter={this.renderItem} />
164
-
);
165
-
},
166
-
167
-
getNumberOfItems:function () {
168
-
// Return the total number of items in the list
169
-
},
170
-
171
-
getItemHeight:function () {
172
-
// Return the height of a single item
173
-
},
174
-
175
-
renderItem:function (index) {
176
-
// Render the item at the given index, usually a <Group>
177
-
},
178
-
179
-
});
180
-
```
181
-
182
-
See the [timeline example](examples/timeline/app.js) for a more complete example.
183
-
184
-
Currently, ListView requires that each item is of the same height. Future versions will support variable height items.
185
-
186
141
## Text sizing
187
142
188
143
React Canvas provides the `measureText` function for computing text metrics.
0 commit comments