开发者

-setCornerRadius not found in custom view

I am making a custom uitableviewcell class and inside this cell I have a square label. I would like to round the corners of开发者_运维知识库 the label(dateBox) using this:

[dateBox.layer setCornerRadius:4.0f];
[dateBox.layer setMasksToBounds:YES];

I do this is other classes and it works fine, but for some reason in the uitableviewcell subclass, I get the warning "setCornerRadius method not found". Does anyone know why this might be?


You need to import QuartzCore and make sure it is an included framework in your project.

#import <QuartzCore/QuartzCore.h>

or

#import <QuartzCore/CALayer.h>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜