【发布时间】:2018-05-31 17:52:45
【问题描述】:
我无法在 ScrollView 下显示我的按钮。可能是什么问题?
return (
<View style={{width: width, height: undefined}}>
<ScrollView style={{width: width, height: undefined}}>
<View style={{flexDirection: 'row', width: width, flexWrap: 'wrap'}}>
{
this.state.photos.map((p, i) => {
return (
<SelectedPhoto
key={i}
index={i}
style={{
width: photoWidth,
height: photoWidth,
}}
limit={this.state.supportLength}
photo={p}
onSelectPhoto={this.onSelectPhoto}
onDeselectPhoto={this.onDeselectPhoto}
/>
);
})
}
</View>
</ScrollView>
<View style={{margin: 20, marginBottom: 40}}>
<Button
raised
onPress={this.onNext}
containerViewStyle={{width: width-80}}
backgroundColor={Colors.red}
title='NEXT' />
</View>
</View>
【问题讨论】:
-
尝试将
height的scrollView设置为屏幕的一半,也许你的scrollView隐藏button -
@flix 你能给我一个带代码的例子吗?我试过了,但没有解决问题
标签: react-native button scrollview