Customized UISegmentedControl draws incorrect divider when segments are disabled
||Date Originated:||12-Mar-2012 07:34 PM|
||Product Version:||>= iOS 5|
When creating a customized UISegmentedControl using the UIAppearance APIs, the incorrect divider image will be drawn when one of the segments is in the disabled state.
Steps to Reproduce:
1. Create a UISegmentedControl with 2 segments
2. Call [mySegmentedControl setDividerImage:myDisabledSelectedDividerImage forLeftSegmentState:UIControlStateDisabled rightSegmentState:UIControlStateSelected barMetrics:UIBarMetricsDefault]
3. Set segment 0 to be disabled ([mySegmentedControl setEnabled:NO forSegmentAtIndex:0])
3. Observe that the divider image drawn is for the UIControlStateNormal-UIControlStateNormal configuration, not the UIControlStateDisabled-UIControlStateSelected configuration.
UIControlStateDisabled-UIControlStateSelected divider image is drawn
UIControlStateNormal-UIControlStateNormal divider image is drawn
Only occurs using the UIAppearance API available from iOS 5 onwards.
If a background image is used for the UIControlStateDisabled state ([UISegmentedControl setBackgroundImage:forState:barMetrics]), the control will draw this image. It seems to only be the divider image that is a problem. More details on the problem can be found at this stack overflow thread: http://stackoverflow.com/questions/9660330/uisegmentedcontrol-does-not-respect-divider-images-set-for-uicontrolstatedisable
Reports posted here will not necessarily be seen by Apple.
All problems should be submitted at bugreport.apple.com before they are posted here.
Please only post information for Radars that you have filed yourself, and please do
not include Apple confidential information in your posts. Thank you!