将图像调整到边界半径视图组件响应本机



Current UI: 图片 1

预期 UI:图像 2

问题是如何将图像适应 react native 中的边框半径视图组件?

只需将您的视图设置为使用resizeMode={'cover'}和宽度和高度100%来制作类似的愿望和其中的图像

<View style={{ flex: 1 }}>
<View style={{ width: '100%', height: '60%', borderBottomLeftRadius: '50%', borderBottomRightRadius: '50%' }}>
<Image source={require(...)} style={{ width: '100%', height: '100%'}} resizeMode={'cover'}/>
</View>
</View>

最新更新