[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

View File

@@ -52,6 +52,7 @@ const styles = StyleSheet.create({
borderWidth: '1px'
},
scrollViewContentContainerStyle: {
backgroundColor: '#eee',
padding: '10px'
}
})

View File

@@ -74,7 +74,8 @@ StyleSheetValidation.addValidStylePropTypes({
display: PropTypes.string,
float: PropTypes.oneOf([ 'left', 'none', 'right' ]),
font: PropTypes.string, /* @private */
listStyle: PropTypes.string
listStyle: PropTypes.string,
WebkitOverflowScrolling: PropTypes.string /* @private */
})
module.exports = StyleSheetValidation

View File

@@ -222,14 +222,16 @@ const styles = StyleSheet.create({
base: {
flex: 1,
overflowX: 'hidden',
overflowY: 'auto'
overflowY: 'auto',
WebkitOverflowScrolling: 'touch'
},
baseHorizontal: {
flexDirection: 'row',
overflowX: 'auto',
overflowY: 'hidden'
},
contentContainer: {
flex: 1
flexGrow: 1
},
contentContainerHorizontal: {
flexDirection: 'row'

View File

@@ -16,6 +16,7 @@ module.exports = {
backgroundColor: ColorPropType,
opacity: number,
overflow: autoOrHiddenOrVisible,
zIndex: number,
/*
* @platform web
*/
@@ -34,5 +35,5 @@ module.exports = {
transition: string,
userSelect: string,
visibility: hiddenOrVisible,
zIndex: number
WebkitOverflowScrolling: oneOf([ 'auto', 'touch' ])
};