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 add开发者_开发百科ing images.. but i want the right solution...so i there any way to change the text/title color???
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];
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.
精彩评论