开发者

CALayer borderColor Error

开发者 https://www.devze.com 2023-03-14 05:01 出处:网络
I have very strange error here is my snippet of code: - (void) drawRect:(CGRect)rect{ CGRect fr = rect;

I have very strange error here is my snippet of code:

- (void) drawRect:(CGRect)rect{
CGRect fr = rect;

fr.size.width = fr.size.width-2*rad;
fr.size.height = fr.size.height-1;
fr.origin.x = rad;

// draw round corners layer
bglayer = [CALayer layer];
bglayer.borderWidth = 1;
bglayer.borderColor =开发者_开发知识库 [UIColor blackColor].CGColor; // Here I receive Error: Expected identifier before '[' token
bglayer.backgroundColor = bgColor.CGColor;
bglayer.cornerRadius = rad;
bglayer.frame = fr;
bglayer.zPosition = -5; // important, otherwise delete button does not fire / is covered
[self.layer addSublayer:bglayer];
......
.....
}

in line where: bglayer.borderColor = [UIColor blackColor].CGColor; I receive this error:

Expected identifier before '[' token

Can somebody help me please :)

0

精彩评论

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