react-native-listview

ListView always scrolls back to the top in react-native

孤街浪徒 提交于 2019-12-05 14:19:54
I am using react-native for a iOS mobile app where I am using ListView to display a list of alarms. I have created my own reusable list view component called ComponentListView in which I can pass in the component that I want to render in each row and the data for the list view. If I have a lot of alarms and I scroll down to see the alarms in the end, it always scrolls back to the top (please see sample app below on rnplay with symptoms) and hence I can't operate on the alarms in the end. I think it may have something to do with how I have created the ComponentListView component because if I

Select a row in ListView react-native to get detail

我怕爱的太早我们不能终老 提交于 2019-12-05 13:06:55
i'm new in react-native. I saw an example in https://facebook.github.io/react-native/docs/sample-application-movies.html . It is building a movies app that fetch movies and display them in a ListView. How can we select a row to get its detail data and display it in other view? Please help. thanks :) Here's what i've done so far: /** * Sample React Native App * https://github.com/facebook/react-native */ import React, { Component, } from 'react'; import { AppRegistry, Image, ListView, StyleSheet, Text, View, Navigator, TouchableOpacity, } from 'react-native'; var REQUEST_URL = 'https://raw

React Native Listview grid layout with Listview elements that align and append independently

我的未来我决定 提交于 2019-12-05 12:30:48
I have a problem regarding the alignment of Listview elements that should be displayed in a more boxed style than in a row style. In the picture you can see the current status, which is produced by using this StyleSheet code used in Listview's contentContainerStyle prop: ListViewStyle: { flexDirection: 'row', flexWrap: 'wrap', } What I want to achieve are wrapped Listview elements without starting a new line after row wrap happened and as a result without having space on the top of of a Listview Element. Any idea how to achieve this nice and clean? Thank you! Mμ. Somebody was trying to do the

ReactNative ListView inconsistent separator lines

限于喜欢 提交于 2019-12-05 05:47:52
On Android 4.4, ListView separator lines are inconsistent in thickness, and some do not render. I can't see how this can be a code issue, this is how I render them: separator: { height: 1, backgroundColor: 'grey', } ... <ListView renderSeparator={(sectionID, rowID) => <View key={`${sectionID}-${rowID}`} style={styles.separator} /> } .../> Here is a screenshot of a View with this problem: This issue does not happen on iOS or Android 6. Anyone had this problem before? Update I did a test, this is not Android4 issue. It happens on all API version when running on Nexus One device (in android

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<

React-native FlatList not rerendering row when props change

。_饼干妹妹 提交于 2019-12-03 09:08:48
问题 I'm having an issue with the new FlatList component. Specifically, it does not rerender it's rows, even though props that the row is dependent on changes. The FlatList docs says that: This is a PureComponent which means that it will not re-render if props remain shallow- equal. Make sure that everything your renderItem function depends on is passed as a prop that is not === after updates, otherwise your UI may not update on changes. This includes the data prop and parent component state. THE

How to Get ListView Section Header to Stick

半城伤御伤魂 提交于 2019-12-03 02:04:43
问题 I have buttons displayed on the top of the screen (used react-native-scrollable-tab-view ). Underneath the buttons, I have ListView with section header on it. Is there a way to get the header to stick to the bottom edge of the tab-view when I am scrolling? I have had a hard time trying to get ListView 's section header to stick to the bottom of Facebook TabBar, and its default is to stick to the top of the screen. When I scroll, the section header slides under the tab-bar. Any thoughts on

Listview with alternating color in react native

旧街凉风 提交于 2019-12-01 09:36:44
I have array of objects like the example below; [{ "id" : 13100, "key" : "Emlak Vergisi", "y" : 135638.98 }, { "id" : 13154, "key" : "Çevre Temizlik ", "y" : 956.17 }, { "id" : 19998, "key" : "Genel Tahakkuk", "y" : 89030.62 }, { "id" : 24998, "key" : "Gecekondu ve So", "y" : 42721.07 }, { "id" : 60000, "key" : "Ortak Gelirler", "y" : 827.42 } ] Is it possible to have a listview with alternating color for each item? I would say this approach is cleaner: renderRow(rowData, sectionID, rowID) { let style = [ styles.row, {'backgroundColor': colors[rowID % colors.length]} ]; return (<View style=

Listview with alternating color in react native

拜拜、爱过 提交于 2019-12-01 06:09:29
问题 I have array of objects like the example below; [{ "id" : 13100, "key" : "Emlak Vergisi", "y" : 135638.98 }, { "id" : 13154, "key" : "Çevre Temizlik ", "y" : 956.17 }, { "id" : 19998, "key" : "Genel Tahakkuk", "y" : 89030.62 }, { "id" : 24998, "key" : "Gecekondu ve So", "y" : 42721.07 }, { "id" : 60000, "key" : "Ortak Gelirler", "y" : 827.42 } ] Is it possible to have a listview with alternating color for each item? 回答1: I would say this approach is cleaner: renderRow(rowData, sectionID,

React-native - Passing data from one screen to another

£可爱£侵袭症+ 提交于 2019-11-30 09:11:29
I am trying to learn how to use react-native, so I am putting up a small app that fetch a list of users from a server, displays it in a listview and where pressing a row opens a screen displaying user's data. I set up a navigator to go from one screen to another. When pressing on the row I am able to open a new screen but I can't figure how to pass data to this new screen. I set up an navigator in index.android.js import React from 'react'; import { AppRegistry, Navigator, } from 'react-native'; import ContactList from './src/containers/ContactList.js'; function MyIndex() { return ( <Navigator