のコンテンツのサイズを測定したいScrollView。
したがって、私はmeasurefromを使用していNativeMethodsMixinます:
import NativeMethodsMixin from 'NativeMethodsMixin'
ここからどこに行くべきかよくわかりません。この問題に関連するほとんどの SO 投稿は古くなっているようです。
refto myを作成する必要があることを理解していますScrollView(作成して を呼び出しました。_scrollViewを使用してアクセスできますthis.refs._scrollView)。
this.refs._scrollView問題は、次のmeasureように渡すことができないことです。
NativeMethodsMixin.measure(this.refs._scrollView, (data) => {
console.log('measure: ', data)
})
次に、次のエラーが表示されます。
ExceptionsManager.js:61 findNodeHandle(...): Argument is not a component (type: object, keys: measure,measureInWindow,measureLayout,setNativeProps,focus,blur,componentWillMount,componentWillReceiveProps)
次に、このgithub issueで説明されているように、実際のノード ハンドルを取得して渡そうとしfindNodeHandleました。measure
const handle = React.findNodeHandle(this.refs._scrollView)
NativeMethodsMixin.measure(handle, (data) => {
console.log('measure: ', data)
})
しかし、これは同じエラーになります。何か案は?