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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:30:15+00:00 2026-05-27T16:30:15+00:00

I’m having a problem with trying to change the colour of my navigation controller

  • 0

I’m having a problem with trying to change the colour of my navigation controller inside my popoverController.
I’m trying to do something like this:

if (self.popoverController == nil) {
    ArtistsViewController *artistsViewController = 
    [[ArtistsViewController alloc]      
     initWithNibName:@"ArtistsViewController" 
     bundle:[NSBundle mainBundle]]; 

    artistsViewController.navigationItem.title = @"Artists";
    UINavigationController *navController = 
    [[UINavigationController alloc] 
     initWithRootViewController:artistsViewController];


    UIPopoverController *popover = 
    [[UIPopoverController alloc] 
     initWithContentViewController:artistsViewController.navigationController];
    artistsViewController.navigationController.navigationBar.tintColor=[UIColor greenColor];

    popover.delegate = self;
    [artistsViewController release];
    [navController release];

    self.popoverController = popover;
    [popover release];
}

[self.popoverController 
 presentPopoverFromBarButtonItem:sender                                    
 permittedArrowDirections:UIPopoverArrowDirectionAny 
 animated:YES];

but it doesn’t work. any suggestions?

  • 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-27T16:30:16+00:00Added an answer on May 27, 2026 at 4:30 pm

    ////////////////////////////////////////

    ////////////**SOLUTION**////////

    ////////////////////////////////////////

    I’m gonna edit this post because i solved my problem and I think could be helpful share my solution here:

    first of all, follow this sample:

    http://mobiforge.com/designing/story/using-popoverview-ipad-app-development

    When It is done go to step two.

    The second step will be add a new popoverBackgroundViewClass:

    Add new file in your project Objective class and call it ‘CustomPopoverBackgroundView’

    ///////////////////////////////////////////////
    ////// CustomPopoverBackgroundView.h  /////////
    ///////////////////////////////////////////////
    
         #import < UIKit/UIKit.h >
         #import < UIKit/UIPopoverBackgroundView.h >
    
        @interface CustomPopoverBackgroundView : UIPopoverBackgroundView{
            UIPopoverArrowDirection direction;
            CGFloat offset;
        }
    
        @end
    
    //////////////////////////////////////////////
    ////// CustomPopoverBackgroundView.m /////////
    //////////////////////////////////////////////
    
    
        #import "CustomPopoverBackgroundView.h"
    
        @implementation CustomPopoverBackgroundView
    
         -  (void)layoutSubviews {
            [super layoutSubviews];
            CGFloat fullHeight = self.frame.size.height;
            CGFloat fullWidth = self.frame.size.width;
            CGFloat startingLeft = 0.0;
            CGFloat startingTop = 0.0;
            CGFloat arrowCoord = 0.0;
    
            UIImage *arrow;
            UIImageView *arrowView;
    
            switch (self.arrowDirection) {
                case UIPopoverArrowDirectionUp:
                    startingTop += 13.0;
                    fullHeight -= 13.0;
        //the image line.png will be the corner 
                    arrow = [UIImage imageNamed:@"line.png"];
                    arrowCoord = (self.frame.size.width / 2) - self.arrowOffset;
                    arrowView = [[[UIImageView alloc] initWithFrame:CGRectMake(arrowCoord, 0, 13.0, 13.0)] autorelease];
                    break;
    
    
                case UIPopoverArrowDirectionDown:
                    fullHeight -= 13.0;
                    arrow = [UIImage imageNamed:@"line.png"];
                    arrowCoord = (self.frame.size.width / 2) - self.arrowOffset;
                    arrowView = [[[UIImageView alloc] initWithFrame:CGRectMake(arrowCoord, fullHeight, 13.0, 13.0)] autorelease];
                    break;
    
                case UIPopoverArrowDirectionLeft:
                    startingLeft += 13.0;
                    fullWidth -= 13.0;
                    arrow = [UIImage imageNamed:@"line.png"];
                    arrowCoord = (self.frame.size.height / 2) - self.arrowOffset;
                    arrowView = [[[UIImageView alloc] initWithFrame:CGRectMake(0, arrowCoord, 13.0, 13.0)] autorelease];
                    break;
    
                case UIPopoverArrowDirectionRight:
                    fullWidth -= 13.0;
                    arrow = [UIImage imageNamed:@"line.png"];
                    arrowCoord = (self.frame.size.height / 2) - self.arrowOffset;
                    arrowView = [[[UIImageView alloc] initWithFrame:CGRectMake(self.frame.size.width-13.0, arrowCoord, 13.0, 13.0)] autorelease];
                    break;
    
            }
    
    
            //this image will be your background
            UIImage *bg = [[UIImage imageNamed:@"lineBack.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(8.0, 8.0, 8.0, 8.0)];
            UIImageView *imageView = [[[UIImageView alloc] initWithFrame:CGRectMake(startingLeft, startingTop, fullWidth, fullHeight)] autorelease];
            [imageView setImage:bg];
            [arrowView setImage:arrow];
            [self addSubview:imageView];
            [self addSubview:arrowView];
        }
    
    
    
        - (CGFloat) arrowOffset {
    
            return offset;
    
        }
    
    
    
        - (void) setArrowOffset:(CGFloat)arrowOffset {
    
            offset = arrowOffset;
    
            [self setNeedsLayout];
    
        }
    
    
    
        - (UIPopoverArrowDirection)arrowDirection {
    
            return direction;
    
        }
    
    
    
        - (void)setArrowDirection:(UIPopoverArrowDirection)arrowDirection {
    
            direction = arrowDirection;
    
            [self setNeedsLayout];
    
        }
    
    
    
        + (CGFloat)arrowHeight {
    
            return 30.0;
    
        }
    
    
    
        + (CGFloat)arrowBase {
    
            return 30.0;
    
        }
    
    
    
        + (UIEdgeInsets)contentViewInsets {
    
            return UIEdgeInsetsMake(30.0, 30.0, 30.0, 30.0);
    
        }
    
        @end
    

    Third step:

    When It is done add this line in ‘PopOverExample1ViewController.m’:

    import the new class:

    #import " CustomPopoverBackgroundView.h "
    
    
    -(IBAction) showMovies:(id) sender {
    
        if (self.popoverController == nil) {
            MoviesViewController *movies = 
                [[MoviesViewController alloc] 
                    initWithNibName:@"MoviesViewController" 
                             bundle:[NSBundle mainBundle]]; 
    
            UIPopoverController *popover = 
                [[UIPopoverController alloc] initWithContentViewController:movies]; 
    
            popover.delegate = self;
            [movies release];
    
    
    //THIS IS THE LINE THAT YOU HAVE TO ADD
    
    
             popover.popoverBackgroundViewClass=[CustomPopoverBackgroundView class];
    
    
            self.popoverController = popover;
            [popover release];
        }
    
        [self.popoverController 
            presentPopoverFromBarButtonItem:sender 
                   permittedArrowDirections:UIPopoverArrowDirectionAny 
                                   animated:YES];    
    }
    
    -(IBAction) btnShowMovies:(id) sender {
    
        if (self.popoverController == nil) {
            MoviesViewController *movies = 
                [[MoviesViewController alloc] 
                    initWithNibName:@"MoviesViewController" 
                             bundle:[NSBundle mainBundle]]; 
    
            UIPopoverController *popover = 
                [[UIPopoverController alloc] initWithContentViewController:movies]; 
    
            popover.delegate = self;
            [movies release];
    
    
    //THIS IS THE LINE THAT YOU HAVE TO ADD
    
    
             popover.popoverBackgroundViewClass=[CustomPopoverBackgroundView class];
    
    
            self.popoverController = popover;
            [popover release];
        }
    
        CGRect popoverRect = [self.view convertRect:[btn frame] 
                                           fromView:[btn superview]];
    
        popoverRect.size.width = MIN(popoverRect.size.width, 100); 
        [self.popoverController 
            presentPopoverFromRect:popoverRect 
                            inView:self.view 
          permittedArrowDirections:UIPopoverArrowDirectionAny 
                          animated:YES];
    }
    

    Alright!!! Thats all! If someOne needs help just let me know.
    Best wishes!

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to render a haml file in a javascript response like so:
I would like to count the length of a string with PHP. The string
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

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.