How do I make a custom UISegmentedControl?
I have 2 images, 1 that should be displayed when the segment is active and the other if the segment is inacti
You can use the methods which are described in the iOS developer libary:
http://developer.apple.com/library/ios/ipad/#documentation/uikit/reference/UISegmentedControl_Class/Reference/UISegmentedControl.html
Scroll down to the "Customizing Appearance" section. There are methods to set background images for several button states, button divider images, etc.
These methods are only available in iOS5 and later.
@property tintColor
– backgroundImageForState:barMetrics:
– setBackgroundImage:forState:barMetrics:
– contentPositionAdjustmentForSegmentType:barMetrics:
– setContentPositionAdjustment:forSegmentType:barMetrics:
– dividerImageForLeftSegmentState:rightSegmentState:barMetrics:
– setDividerImage:forLeftSegmentState:rightSegmentState:barMetrics:
– titleTextAttributesForState:
– setTitleTextAttributes:forState: