我有以下代码来创建渐变按钮:
CAGradientLayer *gradientLayer = [CAGradientLayer layer];
gradientLayer.frame = btnSignUp.layer.bounds;
gradientLayer.colors = [NSArray arrayWithObjects:
(id)[UIColor colorWithWhite:1.0f alpha:0.1f].CGColor,
(id)[UIColor colorWithWhite:0.4f alpha:0.5f].CGColor,
nil];
gradientLayer.cornerRadius = btnSignUp.layer.cornerRadius;
[btnSignUp.layer addSublayer:gradientLayer];
然而,底部的圆角也被涂上了。我不明白为什么会这样。有任何想法吗?
这是图片:http: //imageshack.us/a/img546/509/btnw.png