React Native ImageBackground
组件应该接受与 Image
相同的 prop 签名。但是,它似乎不接受 borderRadius
。
这没有影响。
<ImageBackground
style={{height: 100, width: 100, borderRadius: 6}}
source={{ uri: 'www.imageislocatedhere.com }}
>
如何更改 ImageBackground
的边界半径?
原文由 GollyJer 发布,翻译遵循 CC BY-SA 4.0 许可协议
这需要一些挖掘,因此发布问答以供其他人查找。
ImageBackground
基本上是一个<View>
包装一个<Image>
。style
道具仅将高度和宽度传递给<Image>
。要通过其他
style
道具使用imageStyle
。详细信息记录在源代码 中。