react-native-scrollview

React native scrollview disable pull to refresh

断了今生、忘了曾经 提交于 2019-12-07 16:52:13
问题 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}> <

Create a bidirectional repeating/looping infinite scrollView in react native

荒凉一梦 提交于 2019-12-06 05:30:51
I want to create a scroll that repeats itself, again and again, i.e. when I keep scrolling to the top I reach the last row and when I scroll to the bottom I reach the first row again. I have tried searching components for the same, but the best I could find were these - react-native-infinite-scroll and this stackoverflow answer but both of them only tell about how can I load more data when I reach the ScrollView or ListView end. I searched a lot for this type component but couldn't find any, so I created my own component from scratch using FlatList, and also published it to npm , so anyone can

Automatically scroll the view up when keyboard is shown in react-native

戏子无情 提交于 2019-12-06 04:19:55
How can I automatically scroll the view up when I focus in a TextInput box and a keyboard is shown such that the TextInput box is not hidden behind the keyboard? This question has been asked on StackOverflow a few times and I implemented the solution here which is the general solution advised in most of the answers. This solution works fine in the iPhone simulator but doesn't work on the actual phone. Has anyone else experienced this problem that the solution doesn't work on the actual phone? Second thing that I noticed after adding this solution is that now if I am focussing in a TextInput

React native scrollview disable pull to refresh

六眼飞鱼酱① 提交于 2019-12-05 18:29:47
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> ); } } and my styles: const styles =

Horizontal scroll some part of ListView column

有些话、适合烂在心里 提交于 2019-12-04 16:45:24
问题 I want to horizontally scroll some part of a ListView in React Native. How can I fix the position of first column and make other column horizontally scrollable? 回答1: The renderRow of ListView should have a Text followed by a horizontal ScrollView. <ListView dataSource={this.state.dataSource} renderRow={this.renderRow} /> renderRow (rowData) { return ( <View> <Text>rowData.field1</Text> <ScrollView horizontal={true}> <Text>rowData.field2</Text> <Text>rowData.field3</Text> <Text>rowData.field4<

Drag up a ScrollView then continue scroll in React Native

陌路散爱 提交于 2019-12-03 06:50:19
问题 What I want (GIF) Here is a (quality-reduced) GIF about what I'm want to achieve. What I want (Text) I have a scrollview , that is positioned at the half of my screen. What I want is to drag that scrollview up, and then, when it reaches a certain position, send the drag touch event to scrollview itself, so it can continue scrolling. My tries Put the scrollview in fullscreen in the foreground, and add a half-screen padding-top to its contentContainerStyle . It worked well, but I couldn't click

Drag up a ScrollView then continue scroll in React Native

淺唱寂寞╮ 提交于 2019-12-02 20:29:16
What I want (GIF) Here is a (quality-reduced) GIF about what I'm want to achieve. What I want (Text) I have a scrollview , that is positioned at the half of my screen. What I want is to drag that scrollview up, and then, when it reaches a certain position, send the drag touch event to scrollview itself, so it can continue scrolling. My tries Put the scrollview in fullscreen in the foreground, and add a half-screen padding-top to its contentContainerStyle . It worked well, but I couldn't click the view behind it. Is there a way to click through the empty area of a scrollview? I also tried to

Detect ScrollView has reached the end

血红的双手。 提交于 2019-11-30 12:33:38
问题 I have a Text with long text inside a ScrollView and I want to detect when the user has scrolled to the end of the text so I can enable a button. I've been debugging the event object from the onScroll event but there doesn't seem any value I can use. 回答1: I did it like this: import React from 'react'; import {ScrollView, Text} from 'react-native'; const isCloseToBottom = ({layoutMeasurement, contentOffset, contentSize}) => { const paddingToBottom = 20; return layoutMeasurement.height +

Detect ScrollView has reached the end

拟墨画扇 提交于 2019-11-30 04:34:32
I have a Text with long text inside a ScrollView and I want to detect when the user has scrolled to the end of the text so I can enable a button. I've been debugging the event object from the onScroll event but there doesn't seem any value I can use. I did it like this: import React from 'react'; import {ScrollView, Text} from 'react-native'; const isCloseToBottom = ({layoutMeasurement, contentOffset, contentSize}) => { const paddingToBottom = 20; return layoutMeasurement.height + contentOffset.y >= contentSize.height - paddingToBottom; }; const MyCoolScrollViewComponent = ({enableSomeButton})