简体   繁体   English

特定拐角的拐角半径

[英]Corner radius for a particular corner

I want to set corner radius to each corner separately, but in layer of the view I didn't find property or method for it, only for every corner.我想分别为每个角设置角半径,但是在视图层中我没有找到它的属性或方法,只有每个角。 How can I do it?我该怎么做?

Take a look at this, I think it can be modified to achieve what you want since it rounds the borders using a CGPath: UIView With Rounded Corners看看这个,我认为它可以被修改以实现你想要的,因为它使用 CGPath 使边界变圆: UIView With Rounded Corners

You you could also do it by backing your UIView with a CAShapeLayer and setting the shape on that layer to a path created according to your corner specs.您也可以通过使用 CAShapeLayer 支持 UIView 并将该层上的形状设置为根据您的角规格创建的路径来实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM