Reactjs 图像从带有阴影的容器溢出
我正在尝试为我的RN应用程序创建一个自定义卡片视图,现在我正在处理卡片的封面图像,但图像容器似乎是由与方框阴影冲突引起的(我删除了样式) 这里是我的卡组件的代码Reactjs 图像从带有阴影的容器溢出,reactjs,react-native,Reactjs,React Native,我正在尝试为我的RN应用程序创建一个自定义卡片视图,现在我正在处理卡片的封面图像,但图像容器似乎是由与方框阴影冲突引起的(我删除了样式) 这里是我的卡组件的代码 export const LocationCard: React.FC<Props> = ({ name, imageURI, description, }) => { return ( <View style={styles.card}> <View style=
export const LocationCard: React.FC<Props> = ({
name,
imageURI,
description,
}) => {
return (
<View style={styles.card}>
<View style={styles.imagecontainer}>
<Image
source={{ uri: imageURI }}
style={{ width:"100%",height:"100%", borderRadius: 25, flexWrap:"wrap"}}
resizeMode="cover"
/>
</View>
<View style={styles.content}>
<Text>{name}</Text>
<Text>{description}</Text>
</View>
</View>
);
};
export const LocationCard:React.FC=({
名称
imageURI,
描述
}) => {
返回(
{name}
{说明}
);
};
这里有一张图片供比较
您可以使用=>溢出:“隐藏”
<View style={[styles.imagecontainer, {overflow: 'hidden'}]}>
<Image
source={{uri: imageURI}}
style={{width: '100%', height: '100%', borderRadius: 25, flexWrap: 'wrap'}}
resizeMode="cover"
/>
</View>;
;
您可以使用=>溢出:“隐藏”
<View style={[styles.imagecontainer, {overflow: 'hidden'}]}>
<Image
source={{uri: imageURI}}
style={{width: '100%', height: '100%', borderRadius: 25, flexWrap: 'wrap'}}
resizeMode="cover"
/>
</View>;
;
我的容器背景颜色为白色,效果很好,谢谢!这与我的容器白色背景色工作,谢谢!