react-native-sglistview icon indicating copy to clipboard operation
react-native-sglistview copied to clipboard

Can't set a renderSeparator?

Open webliupeng opened this issue 9 years ago • 3 comments

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"
                    />
                    }
                />

webliupeng avatar Feb 03 '16 12:02 webliupeng

The props for SGListView are transferred directly to the underlying React-Native ListView. Are you sure your separator works with a regular ListView element?

sghiassy avatar Feb 03 '16 14:02 sghiassy

Yes,I'm sure separator works fine with ListView

webliupeng avatar Feb 03 '16 14:02 webliupeng

@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.

rturk avatar Jun 15 '16 00:06 rturk