mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
Support onLayout and onContentSizeChange attributes on ListView
Summary: Docs say they're supported and presumably they should work exactly as for ScrollView but currently they are intercepted by the ListView Closes https://github.com/facebook/react-native/pull/4712 Reviewed By: svcscm Differential Revision: D2745080 Pulled By: vjeux fb-gh-sync-id: 531907f03ae46d5200003cdb335c10b40c7d3bed
This commit is contained in:
committed by
facebook-github-bot-4
parent
ac783a8a1b
commit
3cfcd401c1
@@ -436,6 +436,9 @@ var ListView = React.createClass({
|
|||||||
height : width;
|
height : width;
|
||||||
this._updateVisibleRows();
|
this._updateVisibleRows();
|
||||||
this._renderMoreRowsIfNeeded();
|
this._renderMoreRowsIfNeeded();
|
||||||
|
if (this.props.onContentSizeChange) {
|
||||||
|
this.props.onContentSizeChange(width, height);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_onLayout: function(event) {
|
_onLayout: function(event) {
|
||||||
@@ -444,6 +447,9 @@ var ListView = React.createClass({
|
|||||||
height : width;
|
height : width;
|
||||||
this._updateVisibleRows();
|
this._updateVisibleRows();
|
||||||
this._renderMoreRowsIfNeeded();
|
this._renderMoreRowsIfNeeded();
|
||||||
|
if (this.props.onLayout) {
|
||||||
|
this.props.onLayout(event);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_setScrollVisibleLength: function(left, top, width, height) {
|
_setScrollVisibleLength: function(left, top, width, height) {
|
||||||
|
|||||||
Reference in New Issue
Block a user