我做了一个带有scrollview的表,在scrollview中,对于IOS来说,它的工作原理很好,但是对于android,我无法滚动。我在互联网上做了一些资源,但似乎没有任何作用,你们中的一些人知道解决此问题的方法或替代方法吗?
仪表板(导入表格的地方):
render() {
return (
<ScrollView style={Style.scrollview}>
<View>
<Table />
</View>
</ScrollView>
);
}
表组件(索引):
render() {
return (
<View>
<View style={Style.wrapper}>
<Text style={Style.welcome}>
Total intergrations performance
</Text>
<Text style={Style.dash}>
Overview
</Text>
<View style={Style.tablewrapperdash}>
<Table dataSource={dataSource} columns={columns} />
</View>
</View>
<View style={Style.wrapper}>
<Text style={Style.welcome}>
Google analytics
</Text>
<Text style={Style.dash}>
Intergrations performance overview
</Text>
<View style={Style.tablewrapperdash}>
<Table dataSource={dataSourceGoogle} columns={columnsBing} />
</View>
</View>
<View style={Style.wrapper}>
<Text style={Style.welcome}>
Bing Ads
</Text>
<Text style={Style.dash}>
Intergrations performance overview
</Text>
<View style={Style.tablewrapperdash}>
<Table dataSource={dataSourceBing} columns={columnsGoogle} />
</View>
</View>
</View>
); }
表组件(内容):
render() {
let { dataSource, height } = this.props;
return (
<ScrollView
contentContainerStyle={[Style.contentContainer , { height }]}
horizontal={true}
bounces={false} >
<View>
<View style={Style.tableHeader}>
{ this.renderHeader() }
</View>
<ScrollView style={Style.dataView} >
{ dataSource.map((rowData, index) => this.renderRow(rowData, index)) }
</ScrollView>
</View>
</ScrollView>
);
}