Search code examples
iosuiviewbackgrounduisegmentedcontroluicolor

iOS 7 SegmentControl Background Color


Picture says it all (see arrows). Any way I can make sure the background is transparent? If I set the background to transparent on the UISegmentedControl it sets the button color to transparent too, but we want to avoid this.

enter image description here

Clarification: We want to keep the buttons white, but get rid of the white stuff in the corners. Setting background to white does this but then makes the buton background transparent too, which we don't want.

enter image description here

Update: Now looks as follows, after trying Astri's suggestion and setting corner radius to 5. Still, there is a white space on the right.


Solution

  • After the clarification:

    Try this:

    yourSegmententControl.layer.cornerRadius = 5;
    

    Make sure you import Quartz