我的问题如下。实际上,我使用带图像而不是文本的分段控制。因此,对于图像,我编写了以下代码:
[self.segmentedControl setDividerImage:[UIImage imageNamed:@"DividerImageLeft.png"] forLeftSegmentState:UIControlStateNormal rightSegmentState:UIControlStateSelected barMetrics:UIBarMetricsDefault];
[self.segmentedControl setDividerImage:[UIImage imageNamed:@"DividerImageRight.png"] forLeftSegmentState:UIControlStateSelected rightSegmentState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[self.segmentedControl setImage:[[UIImage imageNamed:@"segment_left.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forSegmentAtIndex:1]; [self.segmentedControl setImage:[[UIImage imageNamed:@"segment_right.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forSegmentAtIndex:0];
结果,分隔线和段之间有一条白线(仅适用于 iOS 7.0+,因为它在 iOS 6.1.3 及更低版本上没有分隔线图像也能正常工作)。我怎样才能删除它? https://www.evernote.com/shard/s305/sh/cda3f2b3-74e6-4268-9d0d-278be9f9e95f/d4110a56f9fe38311cfbe7001d6f9825