react-native-sglistview
react-native-sglistview copied to clipboard
Can't set a renderSeparator?
I set property renderSeparator. it will return a separator .When I scrolling down first separator out screen.the second cell will gone. how can I resolve this problem? thx a lot.
<SGListView
removeClippedSubviews={true}
renderSeparator={(s,i)=><View style={{backgroundColor:"rgb(240, 240, 240)", height:10}} key={i}></View>}
dataSource={this.state.dataSource}
renderRow={this.renderRow}
initialListSize={3}
pageSize={10}
scrollRenderAheadDistance={1}
renderFooter={this.renderFooter}
automaticallyAdjustContentInsets={true}
onEndReachedThreshold={20}
onEndReached={this.onEnd}
onChangeVisibleRows={this.onChangeVisibleRows}
refreshControl={
<RefreshControl
refreshing={this.state.isRefreshing}
onRefresh={this._loadData}
tintColor="rgb(100, 100, 100)"
title="加载..."
colors={['#ff0000', '#00ff00', '#0000ff']}
progressBackgroundColor="#ffff00"
/>
}
/>
The props for SGListView are transferred directly to the underlying React-Native ListView. Are you sure your separator works with a regular ListView element?
Yes,I'm sure separator works fine with ListView
@webliupeng as quick workaround instead of a renderSeparator you can use topMargin in each of your cels. That's what I use in my apps.