//右上角红点
UIButton *redBtn = [[UIButton alloc]initWithFrame:CGRectMake(kBaseOriginX, kBaseOriginY, 15, 15) ];
[redBtn setTitle:@"3" forState:UIControlStateNormal];
[redBtn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
redBtn.titleLabel.textAlignment = NSTextAlignmentCenter;
redBtn.titleLabel.font = [UIFont systemFontOfSize:9.0f];
redBtn.backgroundColor = [UIColor whiteColor];
redBtn.center = CGPointMake(imageView.right, imageView.top);
[redBtn.layer setMasksToBounds:YES]; //设置yes
[redBtn.layer setCornerRadius:7.5f]; //弧度等于宽度的一半 就是圆角
//边框宽度
[redBtn.layer setBorderWidth:2];
[redBtn.layer setBorderColor:[[UIColor redColor] CGColor]];
[personBtn addSubview:redBtn];
uibutton 圆形
最新推荐文章于 2018-11-10 21:10:43 发布