Home Tutorial Iphone Examples Gradient Background iPhone

 
 

Share on Google+Share on Google+
Gradient Background iPhone
Posted on: April 21, 2010 at 12:00 AM
Advertisement
In this tutorial, we are going to show you how to change UINavigationBar Color in Gradient. This example is similar to our previous one, only difference is that this time we are passing four arguments to the tintColor in different range.

Gradient Background iPhone

In this tutorial, we are going to show you how to change UINavigationBar Color in Gradient. This example is similar to our previous one, only difference is that this time we are passing four arguments to the tintColor in different range. That will actually give it a gradient look.

Change Color of the UINavigation Bar

UINavigationBar - Gradient Color

self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:.6 green:.4 blue:.7 alpha:2];

UINavigationBar - Single Color
[self.navigationController.navigationBar setTintColor:[UIColor blackColor]];

Create a Navigation based application and add the given code in the viewController.m (implementation) file.

- (void)viewWillAppear:(BOOL)animated {

[super viewWillAppear:animated];
self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:.6 green:.4 blue:.7 alpha:2];
}

Build your application and it must look like given image...

Download Code

Advertisement

Related Tags for Gradient Background iPhone:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: April 21, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com