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];

posted @ 2016-01-06 15:23  BN笨的很想飞  阅读(170)  评论(0编辑  收藏  举报