0

I just want to draw circle with stroke, the code below draws well but it fills the circle.

I do not want it filled. Please help me

    self.circleView = [[UIView alloc] initWithFrame:CGRectMake(10,20,20,20)];
    circleView.alpha = 0.5;
    self.circleView.layer.cornerRadius = 50;
    self.circleView.backgroundColor = [UIColor whiteColor];
4

1 回答 1

1

改变

self.circleView.backgroundColor = [UIColor whiteColor];

self.circleView.backgroundColor = [UIColor clearColor];

并为边框(描边)添加

self.circleView.layer.borderColor = [[UIColor redColor] CGColor];
self.circleView.layer.borderWidth = 1;
于 2013-07-12T08:26:51.990 回答