UI设置圆角的方向
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];