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

iOS 12.2 报错:RCTScrollView may only contain a single subview

Open xinzsky opened this issue 6 years ago • 8 comments

Simulator Screen Shot - iPhone X - 2019-05-22 at 17 37 01

xinzsky avatar May 22 '19 09:05 xinzsky

请提供更多的代码信息

2534290808 avatar May 25 '19 01:05 2534290808

me too

xinghuoliaoyuan45 avatar Jun 13 '19 07:06 xinghuoliaoyuan45

我单独使用 MJRefresh 作为 refreshControl不知道为啥不行

xinghuoliaoyuan45 avatar Jun 13 '19 07:06 xinghuoliaoyuan45

我单独使用 MJRefresh 作为 refreshControl不知道为啥不行

@xinghuoliaoyuan45 能贴一下你的代码吗?

2534290808 avatar Jun 14 '19 04:06 2534290808

自己使用了 PanResponder 封装了一个不依赖 Native 的组件,可以自定义下拉刷新(需要 RN 0.59+ 的 hooks),欢迎试用

smadey avatar Jun 14 '19 10:06 smadey

<MJFlatList data={data} renderItem={({ item, index }) => { return <Text key={index}>{item}</Text>; }} refreshControl={ <MJRefresh> <View style={{ height: 100, alignItems: 'center', justifyContent: 'center' }} > <Text>Pull Down to Refresh...</Text> </View> </MJRefresh> } /> 直接使用封装的Flatlist会报这个错。

换成example中的代码就不会 <FlatList data={data} renderItem={({ item, index }) => { return <Text key={index}>{item}</Text>; }} renderScrollComponent={props => ( <MJScrollView refreshControl={ <MJRefresh> <View style={{ height: 100, alignItems: 'center', justifyContent: 'center' }} > <Text>Pull Down to Refresh...</Text> </View> </MJRefresh> } > {props.children} </ScrollView> )} />

jungleyu avatar Jul 19 '19 06:07 jungleyu

me too

baiachen avatar Sep 27 '19 13:09 baiachen

是不是已经不维护了

weed-x avatar Oct 21 '20 09:10 weed-x