【发布时间】:2012-04-23 19:37:23
【问题描述】:
我有一个背景 UI 图像,每当我触摸 UIButton 时都会显示:
[btn setImage:[UIImage imageNamed:@"background.png"] forState:UIControlStateNormal];
我还修改了uibutton的图层,给了一个圆角
[btn.layer setCornerRadius:10];
这可行,但圆角半径没有用于背景图像。我可以在
访问图像[btn backgroundImageForState:UIControlEventTouchDown]
但由于这是一个 UIImage,它不会有 CA 层
我想要的是 CALayer 也支持背景图像,或者至少应该支持圆角。
【问题讨论】:
标签: iphone ios uibutton calayer rounded-corners