react-native - 反应带有边框的原生圆形图像
问题描述
我想创建一个带边框的圆形图像。如果我添加borderColor: 'green', borderWidth:1
,边框仅在圆形图像的左上角可见。
<TouchableHighlight
style={[styles.profileImgContainer, { borderColor: 'green', borderWidth:1 }]}
>
<Image source={{ uri:"https://www.t-nation.com/system/publishing/articles/10005529/original/6-Reasons-You-Should-Never-Open-a-Gym.png" }} style={styles.profileImg} />
</TouchableHighlight>
export default styles = StyleSheet.create({
profileImgContainer: {
marginLeft: 8,
height: 80,
width: 80,
borderRadius: 40,
},
profileImg: {
height: 80,
width: 80,
borderRadius: 40,
},
});
解决方案
overflow: 'hidden'
图像容器解决了这个问题。
推荐阅读
- sql - 在 oracle 中旋转时如何添加条件?
- reactjs - 如何根据反应js中的内容设置计数
- github - GitHub 的审核日志如何为不同的事件分配位置?
- python - 从 .tar.gz 中提取 json 文件列表
- linux-kernel - 不小心删除了内核模块,不知道如何重新启用
- flutter - 如何在 Flutter 中将德语字母从 csv 转换为 uft8
- python - 在Django中实现无限滚动期间对内容进行排序以反转
- reactjs - 即使在使用 OnChange 侦听器并更新状态后也无法编辑表单
- c - 如何通过在 C 中丢帧来降低传入流的 fps
- r - 同时使用ggplot进行分组和着色