我想把新的圆圈放在第二个更大的圆圈上。 以下是我的代码:
self.circleView = [[UIView alloc] init];
[self.circleView setBackgroundColor:[UIColor clearColor]];
[self.circleView setClipsToBounds:YES];
[self.circleView.layer setCornerRadius:self.contentView.frame.size.width/2];
[self.circleView.layer setBorderColor:[UIColor colorWithRed:0.80 green:0.26 blue:0.82 alpha:1].CGColor];
[self.circleView.layer setBorderWidth:5];
[self.contentView addSubview:self.circleView];
self.circleView2 = [[UIView alloc] initWithFrame:CGRectMake(self.contentView.frame.size.width/2,20,20,20)];
self.circleView2.layer.cornerRadius = 10;
self.circleView2.backgroundColor = [UIColor blueColor];
[self.contentView addSubview:self.circleView2];
所以,结果现在是: