设置控件某个地方的圆角属性

发布时间:2020-10-20 09:36:12 作者:卓行天下
阅读:503
开发者专用服务器限时活动,0元免费领! 查看>>


这种方式可以控制四个角的圆角属性。

typedef NS_OPTIONS(NSUInteger, UIRectCorner) {

    UIRectCornerTopLeft     = 1 << 0,

    UIRectCornerTopRight    = 1 << 1,

    UIRectCornerBottomLeft  = 1 << 2,

    UIRectCornerBottomRight = 1 << 3,

    UIRectCornerAllCorners  = ~0UL

};

CGRect rect = CGRectMake(00ScreenWidth - PADDING *244);

CAShapeLayer *maskLayer = [[CAShapeLayer allocinit];

maskLayer.frame = rect;

UIBezierPath *maskPath  = [UIBezierPath bezierPathWithRoundedRect:rect                       byRoundingCorners:UIRectCornerAllCorners cornerRadii:CGSizeMake(33)];

maskLayer.path = maskPath.CGPath;

cell.maskLayer = maskLayer;

亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

推荐阅读:
  1. css如何设置4个圆角
  2. css怎么设置边框的圆角样式

开发者交流群:

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

设置控件 某个地方 圆角属性

上一篇:Spring Security如何基于Authentication获取用户信息

下一篇:mongodb初始化并使用node.js实现mongodb操作封装方法

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》
开发者交流群×