我正在尝试使用react-native的固定大小的视图,边框半径和borderWidth来适合我的图像
<CachedImage
resizeMode="contain"
source={{
uri:
"https://s3-us-west-2.amazonaws.com/bracketopia-storage/products/logo_fresh.jpg"
}}
style={{
height: 100,
width: 180,
borderRadius: 10,
overflow: "hidden",
alignItems: "center",
borderWidth: 1,
borderColor: AppColors.grey
}}
/>;
但是我无法实现它,我正在得到一些东西:
删除resizeMode =“ contain”属性
resizemode
将在您传递参数时调整图像的大小,在此处传递contain
参数,然后包含将缩放图像的两个维度,也将缩放视图的相应维度,并根据其纵横比将图像设置为“视图”。
有关更多详细信息,请检查react本机文档:https : //facebook.github.io/react-native/docs/image.html#resizemode
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句