view.layer.cornerRadius = 5;
view.layer.masksToBounds = YES;

其实也不限于圆角了,你可以把layer折腾成各种各样的形状,然后mask view之。

相关文章: