ListView Property
name |
type |
meaning |
Default Value |
DataSource |
Listviewdatasource |
Data set |
No |
Initiallistsize |
Number |
Set the number of elements initialized on the first page |
No |
Onchangevisiblerows |
function |
When there is a change in the visibility of the element, the function is called, the (visiblerows, changedrows) parameter represents the state visible, the state changes the row, when the visible is true, the delegate slides into the view, and the visible is false to indicate that the slide out view |
No |
Onendreached |
function |
Functions that are called after all the elements have been displayed or the slide is finished |
No |
Onendreachedthreshold |
Number |
The threshold value of the pixel, which is used in conjunction with the onendreached, because the flag that onendreached the end of the slide is determined by that value as the |
No |
PageSize |
Number |
The number of rows to display for each cycle event (this meaning is not understood at the time) |
No |
Removeclippedsubviews |
bool |
An option to improve performance is to resolve the overflow method by hiding the row container |
No |
Renderfooter |
function |
Render Bottom |
No |
Renderheader |
function |
Render Head |
No |
Renderrow |
function |
Render Line |
No |
Renderscrollcomponent |
function |
Returns a scrollable component |
No |
Rendersectionheader |
function |
Ominous |
No |
Renderseparator |
function |
Render for a particular element |
No |
Scrollrenderaheaddistance |
Number |
Time of rendering |
No |
Example
' Use strict ';
var React = require (' react-native ');
var {
ListView,
appregistry,
StyleSheet,
View,
Text,
} = React;
var HelloWorld = React.createclass ({
getinitialstate:function () {
var ds = new Listview.datasource ({ Rowhaschanged: (r1, r2) = R1!== R2});
return {
dataSource:ds.cloneWithRows ([' Row 1 ', ' Row 2 ', ' Row 3 ', ' Row 4 ', ' Row 5 ', ' Row 6 ', ' Row 7 ', ' Row 8 ', ' Row 9 '), c14/>};
},
render:function () {
return (
<listview
Datasource={this.state.datasource}
renderrow={(rowdata) = <text>{rowdata}</text>}
initiallistsize={5}
Pagesize={1}
scrollrenderaheaddistance={20}
/>
);}
);
var styles = Stylesheet.create ({
});
Appregistry.registercomponent (' Hellowrold ', () = HelloWorld);
Android
Applies to Android