你可以这样使用
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 36)];
label.backgroundColor=[UIColor orangeColor];
// 设置圆角label.layer.borderWidth = 1.0f;
label.layer.borderColor = [UIColor darkGrayColor].CGColor;
label.layer.cornerRadius = 10.0f;
label.clipsToBounds=YES;
除了设置clipsToBounds = YES 是可以的 还可以设置
maskToBounds = YES 也可以