UIPopoverController arrow not the same white as my UINavigationBar

200 views Asked by At

So the problem that I have is my UIPopoverController's arrow is a different color to my UINavigationBar color. If you look at the image there is a slight shadow on the white and you can see it is not the same white:

enter image description here

This only happens on iOS 8 and not on 7, on 7 it's working as expected.

- (UIPopoverController *)showPopoverController:(UIViewController *)controller fromBarButtonItem:(UIBarButtonItem *)view
{
    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:controller];
    UIPopoverController *popoverController = [[UIPopoverController alloc] initWithContentViewController:navController];

    //  controller.view.frame = CGRectMake(0, 0, 320, 400);

    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];

    appDelegate.popoverController = popoverController;
    CGSize size = CGSizeMake(controller.view.frame.size.width, controller.view.frame.size.height + 44.0);
    [navController setPreferredContentSize:size];
    [popoverController setPopoverContentSize:size];
    [popoverController presentPopoverFromBarButtonItem:view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    [navController.navigationBar setBarTintColor:[UIColor whiteColor]];
    [popoverController setBackgroundColor:[UIColor whiteColor]];

    return popoverController;
}
2

There are 2 answers

0
Robert Shaw On BEST ANSWER

So at the end I needed this little piece of code

self.navigationController.navigationBar.translucent = NO;
0
Michael Kalinin On

I think problem in this line

[popoverController setBackgroundColor:[UIColor whiteColor]];

Color of arrow is the background color of UIPopoverController