我正在尝试获取带有圆角的图像,以便可以将其变成圆形图像。我正在使用vue-nativescript。
html:
core
css:
gzcat /proc/config.gz
我尝试了不同的伸展运动,但似乎都没有做我想要的事情。
答案 0 :(得分:0)
根据doc,您应该这样使用:
.image-logo {
background-color: grey;
border-radius: 20;
height: 100%;
}
如果您想绕一个特定的角,可以尝试以下操作:
https://reactnative.dev/docs/view-style-props#borderbottomleftradius
不错的照片顺便说一句。
答案 1 :(得分:0)
尝试将stretch = "aspectFit"
替换为stretch = "aspectFill"
或stretch = "none"
。我以前也经历过同样的事情
答案 2 :(得分:0)
简单的bordrRadius在Android上不起作用,您必须提供所有4个角的边界半径,即topRight,topLeft,bottomRight和bottomLeft
const width = 20 // whatever is width of your image
const imgStyle = {
borderRadius: width / 2,
borderBottomLeftRadius: width / 2,
borderBottomRightRadius: width / 2,
borderTopRightRadius: width / 2,
borderTopLeftRadius: width / 2
}