实现view底部两个角的圆角效果

 

哪位高人的分享,俺借来一用:

用遮罩

UIBezierPath *maskPath=  [UIBezierPath bezierPathWithRoundedRect:self.contentView.bounds byRoundingCorners:UIRectCornerBottomLeft|UIRectCornerBottomRight cornerRadii:CGSizeMake(5, 5)];

 

    CAShapeLayer *maskLayer=[[CAShapeLayer allocinit];

 

    maskLayer.frame=self.contentView.bounds;

 

    maskLayer.path=maskPath.CGPath;

 

    self.contentView.layer.mask=maskLayer;

 

    self.contentView.layer.masksToBounds=YES;

 

self.contentView 是要实现底部角要圆角的view

posted @ 2015-03-12 16:12  阳光天  阅读(191)  评论(0编辑  收藏  举报