反应原生滚动视图禁用拉动刷新 [英] React native scrollview disable pull to refresh

查看:60
本文介绍了反应原生滚动视图禁用拉动刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 react native v0.44.2 的滚动视图,我想禁用下拉刷新并仅生成我的视图滚动,是否有另一种方法可以在不使用滚动视图的情况下做到这一点?
看到了一些旧版本,不知道是不是最近放了这个动画.所以我的代码如下:

I'm using the scrollview of react native v0.44.2 and I wanted to disable the pull to refresh and only generate the scroll of my views, is there another way to do it without being with scrollview?
I saw some old version, I do not know if I put this animation recently. So my code is as follows:

render() {
    return (
      <View>
        <ScrollView>
          <View style={styles.box}>

          </View>
          <View style={styles.box}>

          </View>
          <View style={styles.box}>

          </View>
          <View style={styles.box}>

          </View>
          <View style={styles.box}>

          </View>
          <View style={styles.box}>

          </View>
        </ScrollView>

      </View>
    );
  }
}

和我的风格:

const styles = StyleSheet.create({

  box: {
    backgroundColor: 'blue',
    height: 300,
    width: 200,
    borderWidth: 5,
    borderColor: 'red'
  }
});

推荐答案

我遇到了同样的问题,通过将bounces 属性设置为false 来解决:

I've faced the same issue, and solved it by setting bounces property to false:

<ScrollView bounces={false} style={{ flex: 1 }}>
...
</ScrollView>

文档:https://facebook.github.io/react-native/docs/scrollview.html#bounces

这篇关于反应原生滚动视图禁用拉动刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆