我有一个矩形图像(jpg),并想用它来填充一个按钮的背景圆角在xcode。
我写了以下内容:
UIButton *button = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
CGRect frame = CGRectMake(x, y, cardWidth, cardHeight);
button.frame = frame;
[button setBackgroundImage:backImage forState:UIControlStateNormal];
然而,我用这种方法得到的按钮并没有圆角:它是一个看起来与我的原始图像一模一样的普通矩形。我怎么才能得到一个圆角的图像来代表我的按钮呢?
谢谢!
https://stackoverflow.com/questions/5047818
复制相似问题