How to change title color in TTLauncherItem?

I have a lot of problems trying to change the color in TTLauncherItem, because the gray color by default does not work with my background.

Any ideas?

+3
source share
2 answers

Here is what I used to change the text color of the TTLauncherItem from default gray to black (looks better on a white background):

(1) Create a stylesheet that inherits from TTDefaultStyleSheet :

Stylesheet.h:

 @interface StyleSheet : TTDefaultStyleSheet {} @end 

Stylesheet.m:

 // Style for TTLauncherItems - (TTStyle*)launcherButton:(UIControlState)state { return [TTPartStyle styleWithName: @"image" style: TTSTYLESTATE(launcherButtonImage:, state) next: [TTTextStyle styleWithFont:[UIFont boldSystemFontOfSize:11] color: RGBCOLOR(0, 0, 0) minimumFontSize: 11 shadowColor: nil shadowOffset: CGSizeZero next: nil]]; } 

(2) In AppDelegate.m, initialize the stylesheet:

 [TTStyleSheet setGlobalStyleSheet:[[[StyleSheet alloc] init] autorelease]]; 

To make this ... in the Style UIFont change the UIFont and RGBCOLOR(0, 0, 0) to suit your requirements.

+9
source

Here you can find the answer: http://groups.google.com/group/three20/browse_thread/thread/552d453dea748645

Basically you need to install TTStyleSheet and complete all your settings there.

0
source

Source: https://habr.com/ru/post/1335608/


All Articles