Gradient Background iPhone


 

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.

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

Ads