【发布时间】:2017-03-20 16:14:18
【问题描述】:
我是 react native 的新手,我在列表视图中显示 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',
【问题讨论】:
标签: android react-native gif