设置View单个圆角
生活随笔
收集整理的這篇文章主要介紹了
设置View单个圆角
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
#pragma mark - 設(shè)置View單個(gè)圓角
+ (void)addCornerWithView:(UIView *)aView type:(UIRectCorner)aCorners size:(CGSize)aSize
{
??? // 根據(jù)矩形畫(huà)帶圓角的曲線
??? UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:aView.bounds byRoundingCorners:aCorners cornerRadii:aSize];
??? CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
??? maskLayer.frame = aView.bounds;
??? maskLayer.path = maskPath.CGPath;
??? aView.layer.mask = maskLayer;
}
總結(jié)
以上是生活随笔為你收集整理的设置View单个圆角的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: perl 5.10.0安装包下载
- 下一篇: 7号信令的学习