ios - React Native ListView with fixed section header that can be updated -
i made section header in listview responds state changes realised need fixed. upon changing renderheader rendersectionheader fixed no longer responds state changes.
<listview datasource={this.state.datasource} renderheader={this.renderheader} renderrow={this._renderrow} /> renderheader: function() { return ( <view> <text>{this.state.header}</text> </view>
in way if state changed, text (or whatever is) update accordingly. when scrolling list header not fixed.
<listview datasource={this.state.datasource} rendersectionheader={this.rendersectionheader} renderrow={this._renderrow} /> rendersectionheader: function() { return ( <view> <text>{this.state.header}</text> </view>
with code above however, section header fixed in place when scrolling when making alterations state strangely not update in section header ordinary header.
if use rendersectionheader
render header, need use clonewithrowsandsections
opposed clonewithrows
.
here pretty discussion on how implement depending on data.
here implementation of clonewithrowsandsections
on github.
Comments
Post a Comment