React-Native RefreshControl取代了Sticky Header iOS

时间:2017-01-04 15:07:48

标签: ios user-interface react-native uirefreshcontrol

在使用粘性标头的ListView中出现问题。当我仍然在刷新时向下滚动时,我的粘性标题向下移动大致等于刷新控件的高度。 知道是什么导致了这个吗?

这是我的ListView和refreshControl的代码:

<View style={{backgroundColor: Colors.stickyHeaderGray, height: SCREEN_HEIGHT-20}}>
      <ListView
        ref='list'
        style={this.container}
        dataSource={this.state.ds}
        initialListSize={12}
        scrollRenderAheadDistance={0}
        onEndReached={() => this.setState({ hideLoadingFooter: true })}
        onEndReachedThreshold={10}
        pageSize={10}
        renderRow={(data) => <FeedItem {...data} navigator={this.props.navigator} />}
        renderSeparator={this._renderSeparator}
        renderSectionHeader={(sectionData, sectionID) =>
          <View style={{backgroundColor: Colors.stickyHeaderGray, opacity: 0.96}}>
            <TouchableHighlight
              onPress={() => this.refs.list.scrollTo({x:0,y:0,animated:true})}
              underlayColor={Colors.stickyHeaderGray}>
              <View>
                <Heading1 style={styles.headers}>{sectionID}
                </Heading1>
              </View>
            </TouchableHighlight>
          </View>
        }
        renderFooter={() =>
          this.state.hideLoadingFooter ? null : <View style={styles.footer}><Heading1>Loading </Heading1><Spinner type={'ThreeBounce'} size={40} color={Colors.wabashRed} isVisible={true} /></View>
      }
      refreshControl={
        <RefreshControl
          refreshing={this.state.refreshing}
          onRefresh={this._onRefresh}
          tintColor={Colors.charcoal}
          />
      }
      />
  </View>

Pull down to refresh

Scroll down while still refreshing

0 个答案:

没有答案