问题标签 [react-native-listview]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
react-native - 在 react-native listview/scrollview 中找出滚动方向
有没有办法找出 react-native 的 listview/scrollview 组件的滚动方向?
原生 iOS 组件似乎可以通过计算与 的偏移量来做到这一点scrollViewWillBeginDragging,scrollViewDidScroll但这些似乎没有绑定。
facebook - React Native: what lifecycle should I look for when I want to refresh ListView whenever I navigate back to it?
Pretty much like the official tutorial here https://facebook.github.io/react-native/docs/tutorial.html:
I have the fetchData method called in ComponentDidMount, but according to this, ComponentDidMountwould only be called once after initial rendering of the component. So should I do call the same fetchData everytime before I navigate back to this ListView, and pass the updated data as props to the ListView, and then update the listView's state parameter accordingly in componentDidUpdate? Or is there any better way to do this?
react-native - React Native:TouchableHighLight onPress 在 ListView 的 renderHeader 方法中不起作用
我这样做的方式如下,当按下标题时,不透明度确实发生了变化,但chrome调试器控制台中没有记录任何内容。
react-native - ListView 总是在 react-native 中滚动回顶部
我正在使用react-native一个 iOS 移动应用程序ListView来显示警报列表。我创建了自己的可重用列表视图组件ComponentListView,在其中我可以传入要在每一行中呈现的组件以及列表视图的数据。如果我有很多警报并且我向下滚动以查看最后的警报,它总是会滚动回顶部(请参阅下面的带有症状的 rnplay 示例应用程序),因此我最终无法对警报进行操作. 我认为这可能与我创建ComponentListView组件的方式有关,因为如果我只使用一个简单的ListView组件,它会按预期工作,但我需要使用ComponentListView组件,因为我有许多不同的屏幕,我必须在其中显示具有不同组件的列表它简化了我的工作。
我在 rnplay 上创建了一个示例应用程序,它显示了这些症状。请在 iOS 上运行。这里AlarmList用于ComponentListView显示警报列表,AlarmSummary是每行中显示的组件。
我尝试使用 ComponentListView 的渲染方法中的一些控制台日志语句对其进行调试,以检查组件是否在滚动时一次又一次地重新渲染,但似乎并非如此。我也尝试在 Chrome 调试器中进行调试,但我有点没有想法,不知道如何/在哪里调试。
如果您有任何解决问题的建议,请告诉我。
react-native - 如何将导航器引用传递给嵌套的子组件?
我想让导航抽屉列表项可点击,在这种情况下,我希望导航器对象导航另一个场景。如何将导航器引用从主组件传递到子组件?我的主要组件的子组件是 ListView 和 ListItems。任何建议都会有所帮助。
reactjs - How to test ReactNative Listview item with enzyme
I am using enzyme to test my component rendering.
What is the usual approach to testing ListView items? For instance, in the following example to test that when an item is clicked, it triggers the onSelect prop passing the id?
I am currently using react-native-mock which means that the ListView does not render anything, and I can't separate the item into a separate component as it needs the onSelect prop from the parent.
android - 如何在 ListView 中调用 renderRow?
我ListView在 react-native 中使用。而且我想ListView按功能更新,所以我this.setState是这样使用的。
按下按钮后,render()方法有效,但renderRow方法无效。所以ListView行不通。我该如何解决?
这是我的列表视图
和我的 _renderRow
我想在按下按钮时更新列表视图,并显示 param.word 包含 this.state.word 的列表
android - React Native Android 上的网格视图
我正在尝试在 React Native Android 上创建一个可滚动的、类似网格的 ListView。
我找到了这个,它看起来和我想做的一模一样:https ://github.com/yelled3/react-native-grid-example
然而,Android 上的风格搞砸了,包装似乎不起作用。我有 2 行,我看不到我所有的元素......
它应该在Android上受支持吗?还是我必须采取完全不同的方法?(即每行有一个组件并手动分解我的数据源)
android - react-native - 如何在React Native的Listview中单行呈现部分的项目?
我正在按照本教程制作一个包含react-native. 但是,我希望以按列方式分隔特定部分的元素,而不是将它们呈现在单独的行中。我试图改变flex方向,但无法做到。
在我的render职能中,我有:
listview如下:
并且renderRow由下式给出:
我想要的是所有Buttons特定部分都显示在单行中,但我无法做到。如何完成这个任务?
