UI设置圆角的方向
2016-01-06 15:23
591 查看
textFidlde.leftViewMode = UITextFieldViewModeAlways;
UIButton *btnGetCode = [UIButton buttonWithType:UIButtonTypeCustom];
[btnGetCode addTarget:self action:@selector(getCode:) forControlEvents:UIControlEventTouchUpInside];
[btnGetCode setTitle:@"获取验证码" forState:UIControlStateNormal];
btnGetCode.backgroundColor = MAINTONE;
[btnGetCode setBackgroundImage:[UIImage imageNamed:@"Background_Colour.png"] forState:UIControlStateNormal];
btnGetCode.frame = CGRectMake(0, 0, 100, 44);
// btnGetCode.layer.cornerRadius = 8.0;
// btnGetCode.layer.masksToBounds = YES;
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:btnGetCode.layer.bounds byRoundingCorners: UIRectCornerBottomRight cornerRadii:CGSizeMake(10, 10)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = btnGetCode.bounds;
maskLayer.path = maskPath.CGPath;
btnGetCode.layer.mask = maskLayer;
[textFidlde addRightViewWithBtn:btnGetCode];
UIButton *btnGetCode = [UIButton buttonWithType:UIButtonTypeCustom];
[btnGetCode addTarget:self action:@selector(getCode:) forControlEvents:UIControlEventTouchUpInside];
[btnGetCode setTitle:@"获取验证码" forState:UIControlStateNormal];
btnGetCode.backgroundColor = MAINTONE;
[btnGetCode setBackgroundImage:[UIImage imageNamed:@"Background_Colour.png"] forState:UIControlStateNormal];
btnGetCode.frame = CGRectMake(0, 0, 100, 44);
// btnGetCode.layer.cornerRadius = 8.0;
// btnGetCode.layer.masksToBounds = YES;
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:btnGetCode.layer.bounds byRoundingCorners: UIRectCornerBottomRight cornerRadii:CGSizeMake(10, 10)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = btnGetCode.bounds;
maskLayer.path = maskPath.CGPath;
btnGetCode.layer.mask = maskLayer;
[textFidlde addRightViewWithBtn:btnGetCode];
相关文章推荐
- Packet for query is too large (12238 > 1024). You can change this value
- Xcode警告:The Copy Bundle Resources build phase contains this target's Info.plist file
- ABMultiValueCopyLabelAtIndex使用不当引起的内存泄漏
- iOS UISearchBar
- QtDesigner修改了ui文件后,程序运行不是修改后的内容。
- Java 基础之 String、StringBuilder、StringBuffer、CharSequence 区别
- IOS开发 把长度不等的UICollectionView 的cell 居左
- 关于UITableView的性能优化(历上最全面的优化分析) ...
- leetcode95 Unique Binary Search Trees II
- leetcode96 Unique Binary Search Trees
- BlockingQueue的使用
- 给UILabel中的文字加删除线
- Ubuntu Builder —— 一个制作自己的发行版的工具
- tasklet和workqueue的选择
- 将CodedUI Test 放到控制台程序中,模拟鼠标键盘操作
- 将CodedUI Test 放到控制台程序中,模拟鼠标键盘操作
- 关于xcode7.2以后 Build Settings Linking 默认没有 Other Linker Flags选项的解决方法
- IOS中UIScrollView的contentSize、contentOffset和contentInset属性
- UIImage 图片处理:截图,缩放,设定大小,存储
- iOS UIPageControl(分页控制器) 用法总结