UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
btn.backgroundColor = [UIColor cyanColor];
btn.frame = CGRectMake(100, 100, 100, 100);
[self.view addSubview:btn];
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:btn.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(10, 10)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = btn.bounds;
maskLayer.path = maskPath.CGPath;
btn.layer.mask = maskLayer;
UIButton UIView 同理。