How do I change the border color of the segmented controller in iOS7 without changing the text color?
It would be ideal if I could keep the line between the segments as is (i.e. same color as the text), but if a border color change implies a change of this line it would also be ok.
Note also that the text (and the lines between segments) have the color which is set with [segmCtrl setTintColor:choosenTintColor]
The linked answer does indeed answer your question, but you have to read between the lines. Here's a clearer example to change all segmented control styles within the app:
For one control within the app:
More info here: https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/UIKitUICatalog/UISegmentedControl.html
So I solved the problem myself. My solution gives the border of the segmented control another color, nothing else.
In order to only change the border color of the segmented control, I put another segmented control on top of my old one. I disabled user interaction for this new one, and I set the image for the selected segment to
nil
.I resolve putting in viewWillAppear mySegmentControl.selectedIndex for all items. So, the tint color appear for all segments. Of course, after selected All items, select your default item again.