問題タブ [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.

0 投票する
0 に答える
67 参照

image - Image in ListView that goes off-screen loses its state (never set to 'loaded')

The situation:

I have a large list of photos and we are loading them in a grid of thumbnails. These thumbnails are each their own component that are loaded in sets of three within the RenderRow function. Here's the Image component in question:

The issue:

Our issue is that if you are scrolling rapidly, or have a less-than-optimal internet connection, some of the images that begin loading never have the "onLoad" called, presumably because they are no longer visible (because we scrolled beyond them in the list already).

However, when we scroll back to those images, all that is rendered is the placeholder image, and the state of the photo is never set to loaded: true. I've tried messing with the onChangeVisibleRows function on the ListView like so:

This seems to work as expected and in the RenderRow function I can check if that specific row is visible, and try to re-render and images in that row by passing a isVisible prop to the image component, but the image component still isn't updating when I return true from shouldComponentUpdate when the isVisible prop changes.

But to no avail.

I believe I'm on the right track, but have hit a dead end. Does anyone have an idea how I can force an image component to reload? Or is there some sort of onLoadInterrupted that might be added so that it begins loading again once it is in view?

0 投票する
1 に答える
3946 参照

react-native - 反応ネイティブ ref (ListView) の高さを測定する

しかない場合、反応ネイティブ要素の高さをどのように測定できますrefか?

NativeMethodsMixinが表示されますが、実装方法が明確ではありません。

私はそれを次のように含めてみました:

NativeMethodsMixinしかし、アプリはそれが未定義であると不平を言います。

RCTUIManager私がルートに行く場合:

次に、エラーが発生します。Uncaught TypeError: Converting circular structure to JSON

その高さを取得したいだけですref。私は何が欠けていますか?

0 投票する
2 に答える
257 参照

react-native - React-native 更新データソース

同様の質問を見つけましたが、何も機能しません。リスト項目をクリックすると、「undefined is not a function this.state.datasource.slice()」というエラーが表示されます

私はすべての「注文」を真にしようとします

0 投票する
1 に答える
413 参照

react-native - すべての行をレンダリングするリストビューの反応ネイティブの問題

APIからデータを取得するリストビューがアプリにあり、それから配列を作成し、そのデータソースを作成してからすべての行をレンダリングします。データセットはそれほど大きくなく、リストビューはいくつかのレンダリングに失敗しますリストビューrenderRowのログでさえ、dataSourceの一部のみがレンダリングされていることを示していますが、ホットリロード時にリストビューからコンテンツコンテナスタイルを削除すると、すべての行がレンダリングされ、再度リロードすると部分的な行のみのレンダリングに戻ります. また、画像はビューに表示されていません。画像がレンダリングされていません

0 投票する
1 に答える
150 参照

ios - 反応するネイティブ アプリケーションの ListView 内に画像が表示されない

画像をレンダリングする ListView があります。

renderRow メソッドは、次のようにイメージをレンダリングします。

画像がレンダリングされません。以下のスクリーンショット: ここに画像の説明を入力

画像を ListView に埋め込むと、画像は適切にレンダリングされました。ListView内で表示可能な画像を取得するためのポインタはありますか?

画像 URL の例: http://s3.amazonaws.com/sendto.us/postcards/fronts/000/000/017/original/from_api.png?1471627160

スタイルの共有:

0 投票する
1 に答える
1408 参照

react-native - 個別に整列および追加する Listview 要素を使用した React Native Listview グリッド レイアウト

行スタイルよりもボックス化されたスタイルで表示する必要がある Listview 要素の配置に関して問題があります。この図では、Listview の contentContainerStyle プロパティで使用されているこの StyleSheet コードを使用して生成された現在のステータスを確認できます。

私が達成したいのは、行の折り返しが発生した後に新しい行を開始せずにリストビュー要素をラップすることであり、その結果、リストビュー要素の上部にスペースがありません。

これをきれいに達成する方法はありますか?ありがとうございました!

0 投票する
1 に答える
3226 参照

android - 反応ネイティブのリストビューで複数のタイプの行を表示する適切な方法は何ですか?

したがって、私たちが望むのは次のようなものです。

複数行タイプ

iOS では、セル タイプごとに複数の cellIdentifier を使用して、パフォーマンスの高いリストビューを作成できます。

私が今持っているのは次のようなものです

および renderRow メソッドで

上記のコードの問題は、dataSource.rowHasChanged メソッドを正しく実装するのが非常に複雑になることです。

何らかの理由で行を削除すると、RN0.31 では次のようないくつかの ui-defects が発生します。

ui-欠陥