Skip to main content

Posts

Showing posts with the label uisegmentedcontrol

UISegmentedControl change event not firing in iOS5

I have a UISegmentedControl whose "Value changed" event is wired up in Interface Builder to call my controller's -(IBAction)segmentChangeAction:(id)sender; When the user taps on the control to change the selected segment, as expected segmentChangeAction is called whether in iOS4 or iOS5. When I programmatically change the selected segment through segmentedControl.selectedSegmentIndex = newIndex; , on iOS4 segmentChangeAction is called and the segment reflects the new selection. However on iOS5 segmentChangeAction is not called, yet the segment does reflect the new selection. Is this a change in iOS5? Is there anything I can do to get segmentChangeAction called on iOS5 when I programmatically change the selection?

Custom UISegmentedControl like the Scope control in UISearchBar

I like to create a UISegmentedControl that looks like the scope button in UISearchBar. Do you know how to do it? Update: So I want to create a UISegmentedControl like this (please notice the appearance), this is not related with UISearchBar, I just want to make it LOOKS LIKE the scope buttons in UISearchBar.