我已经将UIVIew子类化为自定义视图。
-(UIMyMessageView*)init:(NSString*)withMessage
{
[super initWithFrame:messageFrame];
// I Would like to do :
self->layer.cornerRadius = 8; // This doesn't compile
}
为什么我不能设置自己的图层?
答案 0 :(得分:3)
包括QuartzCore Framework
#import <QuartzCore/QuartzCore.h>
还在项目中包含此框架。
http://meandmark.com/blog/2011/03/xcode-4-adding-a-framework-to-your-project/
答案 1 :(得分:1)
你试过了吗?
self.layer.cornerRadius = 8;