Hi friends,
Good day!
I am going to share customize gradient effect in UINavigationBar.
Add this source code to (yourClass.h)
Example: (Do like this)
@interface yourclassname: UIViewController
{
}
#define UIColorFromRGB(rgbValue) [UIColor \
|colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
//RGB color macro with alpha
#define UIColorFromRGBWithAlpha(rgbValue,a) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:a]
@end
Then where you want to add gradient effect like this inside (YourClass.m)
- (void)viewDidLoad
{
[super viewDidLoad];
self.navigationController.navigationBar.tintColor = UIColorFromRGB(0xD2691E);
// (UIColorFromRGB) use this keyWord to set your RGB value.
}
Thats it, tried this to make your own UINavigationBar style.
I hope to help any one.
Thanks
Sampath
Project Leader
MindMade Tech