【问题标题】:RefreshControl sometimes does not hide and acts weirdly on iOSRefreshControl 有时在 iOS 上不会隐藏并且行为怪异
【发布时间】:2016-07-28 00:03:58
【问题描述】:

react-native@0.26 升级后RefreshControl 的活动指示器有时会出现在iOS 上ScrollView 的右上角。 正如文档所说,我正在正确使用 RefreshControl:

...
<ScrollView
  style={styles.container}
  refreshControl={
    <RefreshControl
      refreshing={this.state.isRefreshing}
      onRefresh={this.onPullToRefresh}
    />
  }>
  <View>
    ...
  </View>
</ScrollView>
...

这是有时在不刷新时发生的情况:

现在我正在运行react-native@0.30.0,但这个指标仍然让我很烦。

我是唯一面临这个问题的人吗?

【问题讨论】:

    标签: ios react-native pull-to-refresh


    【解决方案1】:

    通过设置背景为透明色解决...

    ...
    <ScrollView
          style={styles.container}
          refreshControl={
            <RefreshControl
              refreshing={this.state.isRefreshing}
              onRefresh={this.onPullToRefresh}
              style={{backgroundColor: 'transparent'}}
            />
          }>
    ...
    

    【讨论】:

    • 这个问题依然存在。 React Native 有时会给我们带来一些奇怪的问题。
    猜你喜欢
    • 2017-05-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多