Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialGregg Mojica
11,506 PointsChange Color of Button
Hi Guys, Can't seem to get past this code challenge. Not sure what's wrong... Question Now we want to change the color of the text of our navigation bar buttons to white. Use the appearance proxy to change the color using [UIColor whiteColor].
Link: http://teamtreehouse.com/library/styling-the-navigation-bar
My Code
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
UIImage *backgroundImage = [UIImage imageNamed:@"navBarBackground"];
[[UINavigationBar appearance] setBarTintColor:[UIColor redColor]];
[[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], UITextAttributeTextColor, nil]];
return YES;
}
Thanks!
Any ideas Amit Bijlani Ben Jakuben
1 Answer
Rashii Henry
16,433 PointsRight before your return, go ahead and use the appearance proxy again on UINavigationBar. use the setTintColor: method to change the color.
Rashii Henry
16,433 PointsRashii Henry
16,433 Pointsremove all of that titleTextAttributes stuff too, it has nothing to do with the questions.
hint: sometimes you have to think outside of the box versus copying from the video.
Gregg Mojica
11,506 PointsGregg Mojica
11,506 PointsThanks!