UISegmentedControl *segmentC = [[UISegmentedControl alloc]initWithItems:[NSArray arrayWithObjects:@"本周周报",@"历史周报", nil]];
segmentC.frame = CGRectMake(0,0, 120, 30);
segmentC.layer.borderColor = [UIColor whiteColor].CGColor;
segmentC.layer.borderWidth = 1;
segmentC.tintColor = [UIColor whiteColor];
segmentC.backgroundColor = [UIColor clearColor];
NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName,[UIFont systemFontOfSize:14],NSFontAttributeName,nil];
[segmentC setTitleTextAttributes:dic forState:UIControlStateNormal];
segmentC.layer.cornerRadius = 15.0f;
segmentC.layer.masksToBounds = YES;
segmentC.tintColor = [UIColor whiteColor];
self.navigationItem.titleView = segmentC;
UISegmentedControl更改圆角
点赞
收藏