所以这里是代码:
UISegmentedControl * segmentedCtrl = [[UISegmentedControl alloc] initWithFrame:CGRectMake(0, 0, 180, 35)];
//[segmentedCtrl setTintColor:[UIColor brownColor]];
[segmentedCtrl setBackgroundImage:[UIImage imageNamed:@"btn-gradient-brown"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[segmentedCtrl setBackgroundImage:[UIImage imageNamed:@"btn-gradient-brown"] forState:UIControlStateSelected barMetrics:UIBarMetricsDefault];
[segmentedCtrl setBackgroundColor:[UIColor clearColor]];
[segmentedCtrl insertSegmentWithImage:[UIImage imageNamed:nil] atIndex:0 animated:NO];
[segmentedCtrl insertSegmentWithImage:[UIImage imageNamed:nil] atIndex:1 animated:NO];
[segmentedCtrl insertSegmentWithImage:[UIImage imageNamed:nil] atIndex:2 animated:NO];
[segmentedCtrl addTarget:self action:@selector(segmentAction:) forControlEvents:UIControlEventValueChanged];
[segmentedCtrl setSegmentedControlStyle:UISegmentedControlStyleBar];
//[segmentedCtrl setMomentary:YES];
[segmentedCtrl.layer setBorderWidth:1.0];
[segmentedCtrl.layer setCornerRadius:5.0];
但是,当我按下分段控件时,我得到了这个:
任何想法删除蓝色突出显示?
这是我压缩的一个示例项目,它显示了这个问题: