diff --git a/Libraries/CustomComponents/ListView/ListView.js b/Libraries/CustomComponents/ListView/ListView.js index 98cf211d0..f4d4240b9 100644 --- a/Libraries/CustomComponents/ListView/ListView.js +++ b/Libraries/CustomComponents/ListView/ListView.js @@ -406,6 +406,7 @@ var ListView = React.createClass({ // component's original ref instead of clobbering it return React.cloneElement(renderScrollComponent(props), { ref: SCROLLVIEW_REF, + onLayout: this._setScrollVisibleLength, }, header, bodyComponents, footer); }, @@ -424,11 +425,6 @@ var ListView = React.createClass({ logError, this._setScrollContentLength ); - RCTUIManager.measureLayoutRelativeToParent( - React.findNodeHandle(scrollComponent), - logError, - this._setScrollVisibleLength - ); // RCTScrollViewManager.calculateChildFrames is not available on // every platform @@ -444,7 +440,8 @@ var ListView = React.createClass({ height : width; }, - _setScrollVisibleLength: function(left, top, width, height) { + _setScrollVisibleLength: function(event) { + var {width, height} = event.nativeEvent.layout; this.scrollProperties.visibleLength = !this.props.horizontal ? height : width; this._updateVisibleRows();