开发者

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

开发者 https://www.devze.com 2023-01-16 00:18 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消