[fix] ScrollView style issues

* Fix contentContainer not expanding to contain all child elements
* Add momentum scrolling on iOS

Fix #197
This commit is contained in:
Nicolas Gallagher
2016-09-06 12:33:53 -07:00
parent 55849cdd0d
commit e1080d72d7
4 changed files with 9 additions and 4 deletions
@@ -52,6 +52,7 @@ const styles = StyleSheet.create({
borderWidth: '1px' borderWidth: '1px'
}, },
scrollViewContentContainerStyle: { scrollViewContentContainerStyle: {
backgroundColor: '#eee',
padding: '10px' padding: '10px'
} }
}) })
+2 -1
View File
@@ -74,7 +74,8 @@ StyleSheetValidation.addValidStylePropTypes({
display: PropTypes.string, display: PropTypes.string,
float: PropTypes.oneOf([ 'left', 'none', 'right' ]), float: PropTypes.oneOf([ 'left', 'none', 'right' ]),
font: PropTypes.string, /* @private */ font: PropTypes.string, /* @private */
listStyle: PropTypes.string listStyle: PropTypes.string,
WebkitOverflowScrolling: PropTypes.string /* @private */
}) })
module.exports = StyleSheetValidation module.exports = StyleSheetValidation
+4 -2
View File
@@ -222,14 +222,16 @@ const styles = StyleSheet.create({
base: { base: {
flex: 1, flex: 1,
overflowX: 'hidden', overflowX: 'hidden',
overflowY: 'auto' overflowY: 'auto',
WebkitOverflowScrolling: 'touch'
}, },
baseHorizontal: { baseHorizontal: {
flexDirection: 'row',
overflowX: 'auto', overflowX: 'auto',
overflowY: 'hidden' overflowY: 'hidden'
}, },
contentContainer: { contentContainer: {
flex: 1 flexGrow: 1
}, },
contentContainerHorizontal: { contentContainerHorizontal: {
flexDirection: 'row' flexDirection: 'row'
+2 -1
View File
@@ -16,6 +16,7 @@ module.exports = {
backgroundColor: ColorPropType, backgroundColor: ColorPropType,
opacity: number, opacity: number,
overflow: autoOrHiddenOrVisible, overflow: autoOrHiddenOrVisible,
zIndex: number,
/* /*
* @platform web * @platform web
*/ */
@@ -34,5 +35,5 @@ module.exports = {
transition: string, transition: string,
userSelect: string, userSelect: string,
visibility: hiddenOrVisible, visibility: hiddenOrVisible,
zIndex: number WebkitOverflowScrolling: oneOf([ 'auto', 'touch' ])
}; };