Arun Abraham
Arun Abraham

Reputation: 4037

How can i change the text color in a UISegmented Control in iPhone app?

The only solution that i can think of so far is by adding images.. but i want the right solution...so i there any way to change the text/title color???

Upvotes: 0

Views: 5226

Answers (2)

Saad
Saad

Reputation: 8947

use this method, it is in ios 5.x

UIFont *Boldfont = [UIFont systemFontOfSize:13.0f];
    NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:Boldfont,UITextAttributeFont,[UIColor darkTextColor],UITextAttributeTextColor,nil];
    [self.mSegmentControl setTitleTextAttributes:attributes 
                                    forState:UIControlStateNormal];

Upvotes: 4

vfn
vfn

Reputation: 6066

http://www.framewreck.net/2010/07/custom-tintcolor-for-each-segment-of.html

On this post there is the implementation of a category that does what you are looking for.

From iOS SDK, there is no method to do this directly.

Upvotes: 0

Related Questions