0

I have a segment control with 5 segments. I need custom images to be shown on each segment for selected and deselected each.

enter image description here

Problem

The problem is when I place image programmatically on selection of segment I get default blue color on the left side of the segments

enter image description here

4

2 回答 2

0

I finally found a workaround. I changed the UISegmentControl style to Bar and set state Momentary to YES which removed the default blue color on selection. I guess this is a bug in iOS6. Found the solution from another stack overflow question. Thanks to verbumdei

于 2013-06-05T09:00:04.680 回答
0

This seems to be a bug found in iOS6 at the moment. The solution is to change the segmentedControlStyle of the UISegmentedControl to UISegmentedControlStyleBar and set the momentary property to YES.

UISegmentedControl image highlighting bug in iOS6

于 2013-06-05T09:08:08.187 回答