您的位置:首页 > 产品设计 > UI/UE

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];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: