Search code examples
iphonecocoa-touchuikituisegmentedcontrol

UISegmentedControl without rounded corner?


Is there a way of get rid of UISegmentedControl's rounded corners or it is the default behavior?


Solution

  • No, there is no API that gives you control over the layout of the segments.

    You could probably try looking into the UISegmentedControl's view.subviews and try to change them according to your needs. But from personal experience I would not advice that. If Apple changed their order in the future your app will probably crash. The easiest thing to do is to create custom UIButtons that behave as toggle-buttons and control them like a UISegmentedControls (for toggle-buttons see How to use a UIButton as a toggle switch).