简体   繁体   English

自定义形状 UIView

[英]Custom shape UIView

Does anyone know how to create UIView with such shape?有谁知道如何创建具有这种形状的 UIView?

在此处输入图片说明

Thanks!谢谢!

You can use UIBezierPath to draw a mask layer to your UIView.您可以使用 UIBezierPath 为您的 UIView 绘制遮罩层。 After drawing you mask layer you can use drawRect or add a mask to your view's layer.mask .绘制遮罩层后,您可以使用drawRect或向视图的layer.mask添加遮罩。 A similar question was asked before: Drawing UIBezierPath on code generated UIView之前问过一个类似的问题: Drawing UIBezierPath on code generated UIView

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

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