Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

idelovski

macrumors regular
Original poster
What is the point of image property in UISegmentedControl if standard look is drawn underneath my images so resulting control looks like a total mess?

Is there any other way to do a custom drawn segmented control? Googling wasn't much help.
 
You could use UIButtons instead to get a custom look. For each "segment" you want, stack two buttons (one for highlighted and one not pressed) Then hide the buttons not selected.

Code:
- (IBAction)press1{
    //your action
    button1.hidden=YES;
    button1highlight.hidden=NO;
    button2.hidden=NO;
    button2highlight.hidden=YES;
}
- (IBAction)press1highlight{
    button1.hidden=NO;
    button1highlight.hidden=YES;
    button2.hidden=NO;
    button2highlight.hidden=YES;
}
- (IBAction)press2 {
    button1.hidden=NO;
    button1highlight.hidden=YES;
    button2.hidden=YES;
    button2highlight.hidden=NO;
}
- (IBAction)press2highlight{
    button1.hidden=NO;
    button1highlight.hidden=YES;
    button2.hidden=NO;
    button2highlight.hidden=YES;
}


-(void)viewDidLoad{
    button1.hidden=NO;
    button1highlight.hidden=YES;
    button2.hidden=NO;
    button2highlight.hidden=YES;
}

Nick
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.