首页 / IOS / 自定义切圆角 IOS
自定义切圆角 IOS
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了自定义切圆角 IOS,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2133字,纯文字阅读大概需要4分钟。
内容图文
![自定义切圆角 IOS](/upload/InfoBanner/zyjiaocheng/1049/3d04f73c7d46457dbe9cc073fc8514a4.jpg)
NSMutableAttributedString *attString = [[NSMutableAttributedStringalloc] initWithString:@"进击的巨人"];
NSShadow *shadow = [[NSShadowalloc]init];
shadow.shadowColor = [UIColordarkGrayColor];
shadow.shadowBlurRadius = 1;
[attString setAttributes:[NSDictionarydictionaryWithObjectsAndKeys:shadow,NSShadowAttributeName, nil] range:NSMakeRange(0, attString.length)];
UILabel *l = [[UILabelalloc]init];
l.frame = CGRectMake(240, 160, 100, 30);
l.backgroundColor = [UIColorclearColor];
l.attributedText = attString;
[selfaddSubview:l];
-(void)createUI{
UIBezierPath *maskPath = [ UIBezierPath bezierPathWithRoundedRect:_codeBtn.boundsbyRoundingCorners:UIRectCornerTopLeft | UIRectCornerBottomLeftcornerRadii:CGSizeMake(5, 5)];
CAShapeLayer *maskLayer = [[CAShapeLayeralloc] init];
maskLayer.frame = _codeBtn.bounds;
maskLayer.path = maskPath.CGPath;
_codeBtn.layer.mask = maskLayer;
UIBezierPath *maskPath1 = [ UIBezierPath bezierPathWithRoundedRect:_coutryBtn.boundsbyRoundingCorners:UIRectCornerTopRight | UIRectCornerBottomRightcornerRadii:CGSizeMake(5, 5)];
CAShapeLayer *maskLayer1 = [[CAShapeLayeralloc] init];
maskLayer1.frame = _coutryBtn.bounds;
maskLayer1.path = maskPath1.CGPath;
_coutryBtn.layer.mask = maskLayer1;
UIBezierPath *maskPath2 = [ UIBezierPath bezierPathWithRoundedRect:_phoneNo.boundsbyRoundingCorners:UIRectCornerTopLeft | UIRectCornerBottomLeftcornerRadii:CGSizeMake(5, 5)];
CAShapeLayer *maskLayer2 = [[CAShapeLayeralloc] init];
maskLayer2.frame = _phoneNo.bounds;
maskLayer2.path = maskPath2.CGPath;
_phoneNo.layer.mask = maskLayer2;
UIBezierPath *maskPath3 = [ UIBezierPath bezierPathWithRoundedRect:_sendBtn.boundsbyRoundingCorners:UIRectCornerTopRight | UIRectCornerBottomRightcornerRadii:CGSizeMake(5, 5)];
CAShapeLayer *maskLayer3 = [[CAShapeLayeralloc] init];
maskLayer3.frame = _sendBtn.bounds;
maskLayer3.path = maskPath3.CGPath;
_sendBtn.layer.mask = maskLayer3;
// _testLabel.layer.masksToBounds = YES;
// _testLabel.layer.cornerRadius = 5;
//
// _sumbitLabel.layer.masksToBounds = YES;
// _sumbitLabel.layer.cornerRadius = 5;
}
原文:http://blog.csdn.net/chungeshihuatian/article/details/45932171
内容总结
以上是互联网集市为您收集整理的自定义切圆角 IOS全部内容,希望文章能够帮你解决自定义切圆角 IOS所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。