diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index ad5e9edbf..52e20aff6 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -468,11 +468,13 @@ const ScrollView = React.createClass({ this.props.alwaysBounceVertical : !this.props.horizontal; + const baseStyle = this.props.horizontal ? styles.baseHorizontal : styles.baseVertical; + const props = { ...this.props, alwaysBounceHorizontal, alwaysBounceVertical, - style: ([styles.base, this.props.style]: ?Array), + style: ([baseStyle, this.props.style]: ?Array), onTouchStart: this.scrollResponderHandleTouchStart, onTouchMove: this.scrollResponderHandleTouchMove, onTouchEnd: this.scrollResponderHandleTouchEnd, @@ -529,7 +531,7 @@ const ScrollView = React.createClass({ return React.cloneElement( refreshControl, {style: props.style}, - + {contentContainer} ); @@ -544,11 +546,14 @@ const ScrollView = React.createClass({ }); const styles = StyleSheet.create({ - base: { + baseVertical: { flex: 1, }, + baseHorizontal: { + flex: 1, + flexDirection: 'row', + }, contentContainerHorizontal: { - alignSelf: 'flex-start', flexDirection: 'row', }, });