有没有想法如何将borderRadius添加到设置了resizeMode的图像中,而不知道高度和宽度?
代码当前看起来是这样的,但这不起作用。
<View
style={[
styles.imageContainerWrapper,
{ width: width },
]}
key={i}
>
<Image
source={{ uri: url }}
borderRadius={normalize(20)}
resizeMode="contain"
style={{
height: '100%',
maxWidth: '100%',
maxHeight: '100%',
overflow: 'hidden',
backgroundColor: 'blue',
}}
/>
将borderRadius
添加到图像的样式属性中,如下所示:
<View
style={[
styles.imageContainerWrapper,
{ width: width },
]}
key={i}
>
<Image
source={{ uri: url }}
resizeMode="contain"
style={{
height: '100%',
maxWidth: '100%',
maxHeight: '100%',
overflow: 'hidden',
backgroundColor: 'blue',
borderRadius: 20,
}}
/>