I am trying to display a list of Items in a Scroll View horizontally.

When I put my Items in regular View they are stretched across the screen nicely and once I switch the parent Container from View to ScrollView with horizontal flag I see all the items with ScrollView. However all the items are displayed/stretched really wide. I tried adding maxWdith for each of the items and it is not honouring that property at all.

Here is the code I have

export default class PostsContainer extends React.Component { render() { return ( <ScrollView horizontal style={styles.scrollView}> <View style={styles.postsContainer}> <PostContainer /> <PostContainer /> <PostContainer /> </View> </ScrollView> ); } } export default class PostContainer extends React.Component { render() { return ( <View style={styles.postContainer}> {this.renderPostImage} <View style={styles.postTextContentContainer}> <View style={styles.postTextComment}> <View style={styles.postHeadingContainer}> <Text style={{ fontWeight: 'bold', color: '#567' }}> The standard Lorem Ipsum passage</Text> </View> <ScrollView style={styles.postDescription}> <Text style={{ flex: 4, justifyContent: 'flex-start' }}> Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores </Text> </ScrollView> </View> <FontAwesomeIcon style={styles.profileImage} size={40} name="user-o" /> </View> </View> ); } renderPostImage() { if (this.props.imageSrc) { return ( <View> <Image src={this.ptops.imageSrc} /> </View> ); } else { return null; } }

and here are the Styles that I'm using: