I'm having no trouble create a ListView, but I find that if i want to render that ListView inside of a View it breaks and the scroll no longer works.
I understand that two elements can't be next to one another without being wrapped in a parent View but that breaks my ListView. My ListView is rendered the following way, within a React Component named Main.
renderMeeting(meeting) {
return (
<TouchableHighlight>
<View>
<View style={styles.container}>
<View style={styles.imaging}>
<Image source={{uri: meeting.Picture}} style={styles.thumbnail} />
</View>
<View style={styles.rightContainer}>
<Text style={styles.meetingTime}>
{meeting.Time}
</Text>
<View style={styles.firstRow}>
<Text style={styles.meetingName}>
{meeting.Name}
</Text>
<Text style={styles.Title}>
{meeting.Title}
</Text>
<Text style={styles.Company}>
@ {meeting.Company}
</Text>
</View>
<View>
<Text style={styles.meetingDescription}>
{meeting.Description}
</Text>
</View>
</View>
</View>
<View style={styles.borderLine} />
</View>
</TouchableHighlight>
);
}
render() {
return(
<ListView
dataSource={this.state.dataSource}
renderRow={this.renderMeeting.bind(this)}
style={styles.listView} />
);
}
};
When my render method in index.ios.js just returns this Main component, it works just fine:
render() {
return (
<Main>
);
}
However, if I attempt to wrap Main within a View, it does not work:
render() {
return (
<View>
<Main>
</View>
);
}
If I want anything to float over the ListView or if I want to have it only be half page I can't seem to get it to work as long as this component is anywhere is a parent view.