gpt4 book ai didi

android - react native android 中 GIF 图像的圆角问题

转载 作者:搜寻专家 更新时间:2023-11-01 09:39:54 25 4
gpt4 key购买 nike

我是 React Native 的新手,我在 ListView 中显示了一个 GIF 图像列表,我尝试用普通图像来做这个圆角图像,它可以工作,但是对于 GIF 图像,它不工作我现在不为什么。

我使用下面的样式和代码来使角变圆。

  <ListView contentContainerStyle={styles.list}
showsHorizontalScrollIndicator={false}
horizontal= { true }
dataSource={this.state.dataSource}
ref={ref => this.listView = ref}
renderRow={(rowData) => {
return (
<TouchableOpacity style={styles.item} onPress={() => this.stickerSelected(rowData)}>
<Image style={styles.image} source={this.props.images[rowData].src}/>
</TouchableOpacity>
)
}}
/>



list: {
justifyContent: 'center',
flexDirection: 'column',
backgroundColor: '#FFFDEB',
flexWrap: 'wrap',
paddingLeft: 6,
paddingRight: 6


},
item: {
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#EAD62F',
borderRadius: 10,
margin: 3,
width: 75,
height: 75,
},
image: {
width: 75,
height: 75,
borderRadius: 10,
}

并尝试在图像和项目样式中添加以下属性以解决重叠问题,但角落仍然是方形。

 overflow: 'hidden',

最佳答案

您需要设置 overlayColor 样式。它在这里描述https://facebook.github.io/react-native/docs/image.html#style

图像:{
宽度:75,
高度:75,
边界半径:10,
overlayColor: '白色',
}

关于android - react native android 中 GIF 图像的圆角问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40463147/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com