3

Is there any solution to make UIsegmentedControl with Square corner by programming? Please help!!!

Kelly
  • 3,709
  • 4
  • 20
  • 31
sKhan
  • 9,694
  • 16
  • 55
  • 53

2 Answers2

3

You can set background images for the segments that will override the border entirely. If the background images are square, then your segmented control will appear square. Use the following code for each segment state you want to custumise.

[segmentedControl setBackgroundImage:[UIImage imageNamed:@"square-background-image-selected"] forState:UIControlStateSelected barMetrics:UIBarMetricsDefault];

sKhan
  • 9,694
  • 16
  • 55
  • 53
josephap
  • 2,075
  • 17
  • 24
2

use this open source control. it will work fine for you. https://github.com/oettam/MCSegmentedControl

sKhan
  • 9,694
  • 16
  • 55
  • 53