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 7087671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:42:10+00:00 2026-05-28T07:42:10+00:00

In the application delegate within my application I call the following method: – (void)customizeAppearance

  • 0

In the application delegate within my application I call the following method:

- (void)customizeAppearance 
{
    UIImage *gradientPortrait = [[UIImage imageNamed:@"gradient_portrait"] 
        resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];

    UIImage *gradientLandscape = [[UIImage imageNamed:@"gradient_landscape"] 
        resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];

    [[UINavigationBar appearance] setBackgroundImage:gradientPortrait 
        forBarMetrics:UIBarMetricsDefault];
    [[UINavigationBar appearance] setBackgroundImage:gradientLandscape 
        forBarMetrics:UIBarMetricsLandscapePhone];
}

This code allow to customize all the navigation bars within the application. Each bar becomes green since the image I use is green.

Now my goal is to ovveride the above configuration for a specific navigation bar.
In particular, during application lifecycle, I open a modal controller using UIModalPresentationFormSheet presentation style. This controller is presented within a UINavigationController. Since I need also to display the navigation bar attached with that UINavigationController, I would like to know how it is possible to customize that bar, without changing the global configuration I set in the application delegate.

I’ve tried to set both the tintColor property of the navigation bar (presented modally) to [UIColor blackColor] and the barStyle to UIBarStyleBlack, but they don’t work. Only barbutton items are affected.

Thank you in advance.

P.S. I’m using iOS 5

  • 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-28T07:42:11+00:00Added an answer on May 28, 2026 at 7:42 am

    First of all if you don’t mind your image stretched you don’t need to use the resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0) method.

    UIImage *gradientPortrait = [UIImage imageNamed:@"gradient_portrait"];
    UIImage *gradientLandscape = [UIImage imageNamed:@"gradient_landscape"];
    
    UIImage *someOtherImage = [UIImage imageNamed:@"someOtherImageName"];
    

    Then, to achieve what you want:

    1. Make sure you subclass the ViewController on with the custom Navigationbar will appear
    2. Use the following to add the default image to all of your Navigation Bars

      [[UINavigationBar appearance] setBackgroundImage:gradientPortrait forBarMetrics:UIBarMetricsDefault];
      
    3. Use the following to add the specific image to navigationbars wich will appear above the subclassed ViewControllers

      [[UINavigationBar appearanceWhenContainedIn:[YOURSUBCLASS class], nil] setBackgroundImage:someOtherImage forBarMetrics:UIBarMetricsDefault];
      

    (you can call these methods from somewhere in your app delegate)

    btw, if you just want to change the tint color you could just use the tintColor Property instead of all the images.

    for more info check out the appearance sections of: UINavigationBar Class Reference

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

Sidebar

Related Questions

I am wondering if an iOS app delegate's application:didFinishLaunchingWithOptions: method executes from within the
I have my main application delegate which contains a method that returns an object.
Whenever I call smtpClient.SendAsync(...) from within my ASP.NET MVC application, the asynchronous requests are
I am using a variable/propery of my application delegate as a global. (I don't
I have two view controller classes in my application delegate. I can change from
Here is my setup. In my application delegate, I have a property called currentFoo.
I am developing a Silverlight 3 application and I would like to delegate all
I'm writing a Cocoa application where I have an auto generated app delegate:(MyAppDelegate.h/MyAppDelegate.m) So
I've read that the C# version is as follows: Application.Current.Dispatcher.Invoke( DispatcherPriority.Background, new Action(delegate {
In my application I am executing 10 asynchronous NSURLConnections within an NSOperationQueue as NSInvocationOperations.

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.