React-native Demo (8)-List view

Source: Internet
Author: User

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
Instance
' use strict ';varReact =require(' react-native ');var{ListView, appregistry, StyleSheet, View, Text,} = React;varHelloWorld = React.createclass ({getinitialstate:function() {varDS =NewListview.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 ']),    }; },Render:function(){return (<listview datasource={this. State.datasource} renderrow={(rowdata) = <text> ; {rowdata}</text>} initiallistsize={5} pagesize={1} scrollrenderaheaddistance= {/>}); },});var Styles=StyleSheet.Create({});Appregistry.registercomponent(' Hellowrold ', () = HelloWorld);

Android

Applies to Android

React-native Demo (8)-List view

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.