問題タブ [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.
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?
react-native - 反応ネイティブ ref (ListView) の高さを測定する
しかない場合、反応ネイティブ要素の高さをどのように測定できますref
か?
NativeMethodsMixinが表示されますが、実装方法が明確ではありません。
私はそれを次のように含めてみました:
NativeMethodsMixin
しかし、アプリはそれが未定義であると不平を言います。
RCTUIManager
私がルートに行く場合:
次に、エラーが発生します。Uncaught TypeError: Converting circular structure to JSON
その高さを取得したいだけですref
。私は何が欠けていますか?
react-native - React-native 更新データソース
同様の質問を見つけましたが、何も機能しません。リスト項目をクリックすると、「undefined is not a function this.state.datasource.slice()」というエラーが表示されます
私はすべての「注文」を真にしようとします
ios - 反応するネイティブ アプリケーションの ListView 内に画像が表示されない
画像をレンダリングする ListView があります。
renderRow メソッドは、次のようにイメージをレンダリングします。
画像を ListView に埋め込むと、画像は適切にレンダリングされました。ListView内で表示可能な画像を取得するためのポインタはありますか?
画像 URL の例: http://s3.amazonaws.com/sendto.us/postcards/fronts/000/000/017/original/from_api.png?1471627160
スタイルの共有: