Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7078631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:34:18+00:00 2026-05-28T06:34:18+00:00

In my universal app, I am setting an image on navigation bar…using ** objective

  • 0

In my universal app,

I am setting an image on navigation bar…using **

objective c category...on UINavigationBar

**

The code works fine in ios 5.0 in iphone
*The code works fine in ios 4.3 in iPhone/iPad*

*But not working in **ios 5.0 iPad***





- (void) drawRect:(CGRect)rect 
    {
    UIImage *image;

   image = [UIImage imageNamed: @"Navigation.png"];

    [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];  

      [self setTintColor:[UIColor clearColor]];

      NSLog(@"Draw Rect");

    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:34:19+00:00Added an answer on May 28, 2026 at 6:34 am

    To set a BG image for navigation bar in iOS 5 you can use the below code

    if ([self.navigationController.navigationBar respondsToSelector:@selector( setBackgroundImage:forBarMetrics:)]){
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"Navigation.png"] forBarMetrics:UIBarMetricsDefault];
    }
    

    But please keep in mind that this wont work in iOS 4. To make it work in both you also need to add a category to UINavigationBar

    @implementation UINavigationBar (UINavigationBarCategory)
    - (void)drawRect:(CGRect)rect {
    UIImage *img = [UIImage imageNamed:@"Navigation.png"];
    [img drawInRect:rect];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to build my first universal iOS app using the default Xcode templates
I have been working on the front-end to a universal iOS app, setting up
I have a universal app built that runs and works perfectly on an iPad,
I have a Universal App in which I customize my UINavigationBar. In my iPhone
So I have a universal app and I'm setting up the content size of
I have a universal app, and on the iPad version I'm using UISplitViewController to
I started today to upgrade my iPhone-App to an Universal-App. So I'm using Xcode
Using Sqlite in a dylib in an i386 app in XCode 4 For iOS
I am testing a Universal app (IOS 4.3) on both iPhone/iPad simulator. It has
I have developed the universal app using xcode 4.2. It is the time to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.