所以我有以下代码 来设置分割控制背景颜色:
UISegmentedControl * segmentedCtrl = [[UISegmentedControl alloc] initWithFrame:CGRectMake(0, 0, 150, 35)];
[segmentedCtrl setBackgroundImage:[UIImage imageNamed:@"btn-gradient-brown"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[segmentedCtrl setBackgroundImage:[UIImage imageNamed:@"btn-gradient-brown"] forState:UIControlStateSelected barMetrics:UIBarMetricsDefault];
[segmentedCtrl insertSegmentWithImage:[UIImage imageNamed:@"icon-home.png"] atIndex:0 animated:NO];
[segmentedCtrl insertSegmentWithImage:[UIImage imageNamed:@"icon-star.png"] atIndex:1 animated:NO];
一切正常, 除了当我点击段段时, 我可以看到蓝色按钮被突出显示。 我如何禁用此突出显示? 这里截图显示我的问题 :
""https://i.sstatic.net/GFxX9.png" alt="此处的内置图像描述"/"