-3

I want Custom navigation bar with size =60 .And In this navigation bar i add my custom image to this. I write this code..

    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"1.png"] forBarMetrics:UIBarMetricsDefault];

help me thanks in advance

Milan patel
  • 223
  • 2
  • 15

2 Answers2

0

hope this will help you

ok , you want to customize the height of navigation bar(according apple designing guildelines you should ignored it but there are many beautiful apps in app store with customize navigation bar height).

the one way i got to know to customize the navigation bar by subclassing UINavigationBar and and overvide the following method

- (CGSize)sizeThatFits:(CGSize)size 
{  
    CGSize customizeSize = CGSizeMake(customizeWidth , customizeWidthHeight);
    return customizeSize;
}
Anurag Bhakuni
  • 2,379
  • 26
  • 32
-4

UIImageView *imgView = [[UIImageView alloc] initWithFrame:SOMEFRAME]; imgView.image = SOMEIMAGE;

self.navigationItem.titleView = imgView;

navigation bar has the property title view. U can add any Elements u want on it.

Indrajeet
  • 5,490
  • 2
  • 28
  • 43
  • 1
    don't think it's a good practise to use navigationItem.titleView as the background of the navigation bar – meim Sep 09 '14 at 12:19