UIView *view = [[UIView alloc]initWithFrame:CGRectMake(10, 300, 300, 40)];
view.backgroundColor = [UIColor whiteColor];
[self.view addSubview:view];
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, 5, 300, 30)];
label.text = @"100/500";
label.textColor = [UIColor redColor];
label.textAlignment = NSTextAlignmentCenter;
label.backgroundColor = [UIColor whiteColor];
[view addSubview:label];
UIView *view1 = [[UIView alloc]initWithFrame:CGRectMake(10, 305, 140, 30)];
view1.backgroundColor = [UIColor redColor];
view1.layer.cornerRadius = 10;
view1.layer.masksToBounds = YES;
[self.view addSubview:view1];
UILabel *label1 = [[UILabel alloc]initWithFrame:CGRectMake(0,0, 300, 30)];
label1.text = @"100/500";
label1.textColor = [UIColor whiteColor];
label1.textAlignment = NSTextAlignmentCenter;
label1.layer.masksToBounds = YES;
[view1 addSubview:label1];
想要了解更多请关注公众号