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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:23:22+00:00 2026-05-31T23:23:22+00:00

I have a problem with the display of my popover. After initWithContentViewController: and presentPopoverFromBarButtonItem:permittedArrowDirections:animated:

  • 0

I have a problem with the display of my popover. After initWithContentViewController: and presentPopoverFromBarButtonItem:permittedArrowDirections:animated: it cuts corners of the navigation bar. How should I fix it?? Thanks.

Clipping corners of navigation bar

This is the code I’m using

    NavContr *nav = [NavContr new];
    nav.navigationBar.backgroundColor = [UIColor redColor];
    UIPopoverController *tempPop = [[UIPopoverController alloc] initWithContentViewController:nav];
    [tempPop presentPopoverFromBarButtonItem:mainButtonItem permittedArrowDirections:UIPopoverArrowDirectionUp animated:NO];

EDIT: I have resolved this problem:

+ (void)configure:(UINavigationController *)navController {
    UINavigationBar *navigationBar = navController.navigationBar;       
    UIView *contentView = nil;

    for (UIView *view in navController.view.subviews) {
        if ([[NSString stringWithFormat:@"%@", [view class]] isEqualToString:@"UILayoutContainerView"])
            contentView = view;
    }

    // setting frame to navigation bar and content view
    [navigationBar setFrame:CGRectMake(navigationBar.frame.origin.x, 0, navigationBar.frame.size.width, navigationBar.frame.size.height)];
    [contentView setFrame:CGRectMake(contentView.frame.origin.x, 0, contentView.frame.size.width, contentView.frame.size.height + navigationBar.frame.size.height)];

    [navController.view bringSubviewToFront:contentView];

    for (UIView *customView in contentView.subviews)
        customView.frame = CGRectMake(customView.frame.origin.x, customView.frame.origin.y + navigationBar.frame.size.height, customView.frame.size.width, customView.frame.size.height);

    [contentView addSubview:navigationBar];
    [contentView bringSubviewToFront:navigationBar];
}
  • 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-31T23:23:23+00:00Added an answer on May 31, 2026 at 11:23 pm

    This is probably because you have no root view controller, or are otherwise fiddling with the navigation controller in ways it was not meant to be played with. This is how you ought to be setting up the popover:

    MyCustomViewController *viewController = [[UIViewController alloc] initWithNibName:@"MyCustomViewController" bundle:nil]; //or storyboard or whatever
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:viewController]; //you should have a root view controller before displaying the popover
    tintColor = [UIColor redColor];
    UIPopoverController *tempPop = [[UIPopoverController alloc] initWithContentViewController:nav];
    [tempPop presentPopoverFromBarButtonItem:mainButtonItem permittedArrowDirections:UIPopoverArrowDirectionUp animated:NO];
    

    There are a few very important things going on here:

    • Your navigation controller should have a root view controller before you display it.
    • This code is using a standard UINavigationController instance. According to the documentation, you should not subclass UINavigationController, nor should you try and reinvent the wheel. Apple has created a complex and comprehensive framework, UIKit, that you can use to build amazing apps. If you try and step outside the box, you’ll be creating an awful lot of work for yourself without any appreciable benefit.
    • This is using the tintColor property of the UINavigationBar class. If the tint is insufficient for your UI, you can also set the background image manually (refer to the docs).

    If you want to make a popover with a navigation controller, use the built-in UINavigationController class. Don’t subclass it and don’t reinvent it. To customize the appearance of the navigationBar, use the UI_APPEARANCE_SELECTOR methods in the UINavigationBar class.

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

Sidebar

Related Questions

i have a problem in display:inline and display:inline-block.......how should i define both in css...i.e
I have a problem appending the imageNameArray where it is suppose to display file
I have a problem with li , when I take li in inline display
i have a problem with VIMEO video . I want to display it in
I have a similar problem to this post . I need to display up
I have an strange problem using two borders. I use them to display video
I used pole display(E POS) in my POS c# application.I have two major problem
I have to display Datetime in my gridview, the problem is that while I
I have this mysql tables I want to display with jqgrid. The problem appears
Salvete! I have a simple InDesign script to display a palette window. Problem is,

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.