So, in my application, I have a popover control with a built-in navigation control. In different parts of the navigation stack, I want the popover to be in different colors depending on where the user is located. A strange thing sometimes sets the background color of a popover makes this awful looking box around it, sometimes it doesnβt. It looks like this:

This is the look I'm trying to get:

It seems that if I changed the background color before displaying the popover, it seems to work correctly and translate correctly, but if I did not set the color of the popover before displaying it, change it after it is shown that it has a window effect, I also I noticed other cases when this happens by accident, but I canβt explain what causes it (my real application is much more complicated than this demo). Here is the relevant code:
- (IBAction)buttonPressed:(id)sender {
UIViewController *vc = [[UIViewController alloc] init];
UIButton *b = [[UIButton alloc] init];
[b addTarget:self action:@selector(innerButtonPressed) forControlEvents:UIControlEventTouchUpInside];
[b setTitle:@"Button" forState:UIControlStateNormal];
[b setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
[b setFrame:CGRectMake(0,0,100,100)];
[vc.view addSubview:b];
_innerNav = [[UINavigationController alloc] initWithRootViewController:vc];
_popOver = [[UIPopoverController alloc] initWithContentViewController:_innerNav];
_popOver.backgroundColor = [UIColor yellowColor];
[_popOver presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
}
-(void)innerButtonPressed {
_controller = [[UIViewController alloc] init];
UIButton *b = [[UIButton alloc] init];
[b addTarget:self action:@selector(test) forControlEvents:UIControlEventTouchUpInside];
[b setTitle:@"Make Purple" forState:UIControlStateNormal];
[b setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
[b setFrame:CGRectMake(0,0,200,200)];
[_controller.view addSubview:b];
[_popOver setBackgroundColor:[UIColor orangeColor]];
[_innerNav pushViewController:_controller animated:YES];
}
-(void)test{
_popOver.backgroundColor = [UIColor purpleColor];
}
Any idea what is causing this problem? And what are the steps to safely update the popover background color without even getting into this state? I have a complete project demonstrating the problem, I thought that you can attach the projects to the questions, but apparently you cannot. If someone wants this, I can possibly post it somewhere.