Javascript 反应本机元素隐藏卡图像的底部
我正在处理一张包含react原生元素的卡片,我试图隐藏卡片的底部,因为它是一个空白。嗯,我不知道是页脚还是尺码不合适。我对react native和style是新手,我不知道你们是否可以像CSS一样在网页中禁用或隐藏。抱歉这个愚蠢的问题,但我没有一个明确的想法!谢谢你的帮助 这是我的卡片视图:Javascript 反应本机元素隐藏卡图像的底部,javascript,reactjs,react-native,Javascript,Reactjs,React Native,我正在处理一张包含react原生元素的卡片,我试图隐藏卡片的底部,因为它是一个空白。嗯,我不知道是页脚还是尺码不合适。我对react native和style是新手,我不知道你们是否可以像CSS一样在网页中禁用或隐藏。抱歉这个愚蠢的问题,但我没有一个明确的想法!谢谢你的帮助 这是我的卡片视图: return( <ScrollView style={{ }}> <Image sour
return(
<ScrollView style={{
}}>
<Image
source={this.state.imagenes[posicion]}
resizeMode={'cover'}
style={{ width: '100%', height: 200 }}
/>
<View style={styles.ProductosCategoriaPadre}>
<View style={{ width: '50%'}}>
<Card
title='STACKOVERFLOW'
image={require('../imagenes/imagen4.jpg')}
>
</Card>
</View>
<View style={{ width: '50%'}}>
<Card
title='STACKOVERFLOW'
image={require('../imagenes/imagen2.jpg')}
>
</Card>
</View>
</View>
<View style={styles.ProductosCategoriaPadre}>
<View style={{ width: '50%'}}>
<Card
title='STACKOVERFLOW'
image={require('../imagenes/imagen2.jpg')}
>
</Card>
</View>
<View style={{ width: '50%'}}>
<Card
title='STACKOVERFLOW'
image={require('../imagenes/imagen2.jpg')}
>
</Card>
</View>
</View>
<View style={styles.ProductosCategoriaPadre}>
<View style={{ width: '50%'}}>
<Card
title='STACKOVERFLOW'
image={require('../imagenes/imagen2.jpg')}
>
</Card>
</View>
<View style={{ width: '50%'}}>
<Card
title='STACKOVERFLOW'
image={require('../imagenes/imagen2.jpg')}
>
</Card>
</View>
</View>
</ScrollView>
);
您可以在图像中看到这张卡:
您可能需要为容器添加样式以消除间距,如下所示:
<Card containerStyle={{padding: 0}}>
添加容器样式并从卡片的道具中保留图像解决了问题。非常感谢。