0

So I have a UISegmentedControl with custom backgroundImage.. Here's how I set it up:

UISegmentedControl * segmentedCtrl = [[UISegmentedControl alloc] initWithFrame:CGRectMake(0, 0, 178, 30)];
[segmentedCtrl setSegmentedControlStyle:UISegmentedControlStyleBar];
[segmentedCtrl setTintColor:[UIColor clearColor]];

[segmentedCtrl setSegmentedControlStyle:UISegmentedControlStyleBezeled];
[segmentedCtrl insertSegmentWithImage:[UIImage imageNamed:@"btn-home-down.png"] atIndex:0 animated:NO];
.....
 [segmentedControl setImage:[UIImage imageNamed:@"btn-home.png"]  forSegmentAtIndex:0];
    [segmentedControl setImage:[UIImage imageNamed:@"btn-popular.png"] forSegmentAtIndex:1];
    [segmentedControl setImage:[UIImage imageNamed:@"btn-my-photos.png"] forSegmentAtIndex:2];
    [segmentedControl setImage:[UIImage imageNamed:@"btn-places.png"] forSegmentAtIndex:3];
    [segmentedControl setImage:[UIImage imageNamed:@"btn-my-likes"] forSegmentAtIndex:4];

Now the issue is this:

enter image description here

If you see closely between the segment image, on the divider line at the bottom I sort of have a white dot. All of my images are set to square.. why is this and how can I eliminate this?

xonegirlz
  • 8,889
  • 19
  • 69
  • 127
  • Maybe this will help you, http://stackoverflow.com/questions/8016331/uisegmentedcontrol-with-custom-color-separator-line-bug – relower Jun 03 '12 at 00:41

1 Answers1

0

Maybe you could get a UIImageView with only one pixel colored in with the color that the white pixel should be. Then you could placed it on top of the white pixel. This probably isn't the best way of doing this, but it works.

Hope this helps.

pasawaya
  • 11,515
  • 7
  • 53
  • 92