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

  • SEARCH
  • Home
  • 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 6691347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:44:28+00:00 2026-05-26T05:44:28+00:00

Have a little design issue after having upgraded to iOS 5 and Xcode 4.2

  • 0

Have a little design issue after having upgraded to iOS 5 and Xcode 4.2

This is how my view looked in iOS 4:

1 http://casperslynge.dk/1

And this is how it looks like in iOS 5:

2 http://casperslynge.dk/2

In my navigation delegate I have the following method to draw the “image” at the top:

- (void)drawRect:(CGRect)rect {
    UIImage *image;
    if(self.barStyle == UIBarStyleDefault){
        image = [UIImage imageNamed: @"topbar_base.png"];
    }
    else{
        image = [UIImage imageNamed: @"nyhedsbar_base.png"];    
    }
    [image drawInRect:CGRectMake(-1, -1, self.frame.size.width+3, self.frame.size.height+3)];
}

And inside my controller I set the following:

self.navigationBarStyle = UIBarStyleBlack;

How come it is not working in iOS 5?

Thanks

  • 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-26T05:44:29+00:00Added an answer on May 26, 2026 at 5:44 am

    Under iOS5, you need to use UIAppearance. Have a look at that. Here’s an example for using it conditionally so that you can continue to support iOS4:

    // iOS5-only to customize the nav bar appearance
    if ([[UINavigationBar class] respondsToSelector:@selector(appearance)]) {
        UIImage *img = [UIImage imageNamed: @"NavBarBackground.png"];
        [[UINavigationBar appearance] setBackgroundImage:img forBarMetrics:UIBarMetricsDefault];
    }
    

    As you can see, this sets a custom background image for all UINavigationBars. There are lots of things you can do with UIAppearance. You’ll want to keep any custom stuff you’re currently doing in drawRect: since pre-iOS4 devices will still use that and not the new UIAppearance code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i just have a little design question. If i got this code public Interface
I have a little project and I have some SQL design issue with my
I have the following SQL design issue. The code below might look a little
I must have a little design in javascript. I have a menu with 5
I have little question about how web browser retrieve webpage? I know this User
I'm modeling a Poker game and I have a little design doubt: I've a
After comming from Ruby world, I'm having little problems doing TDD in Java. The
What is the closest design pattern for something like an issue tracker? You have
well i have little knowledge in JavaScript. My idea is to design a grid
i'm currently (trying) to program a little game. And i have a small design/deadlock

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.