How to display NavigationController-background within a UIPopoverController on iPhone?

At first UINavigationController doesn't have own background, it shows background of content view controller. If you can show popover with navigation controller successfully, then check your InfoView. Does it's view has some background?

Up vote 1 down vote favorite share g+ share fb share tw.

At the moment it looks like that: In my PopoverView-ViewController: - (void)viewDidLoad { super viewDidLoad; self. NavigationController.navigationBar. Hidden = NO; self.

NavigationController. NavigationBarHidden = NO; self.navigationItem. Title = @"self.navigationItem.

Title"; } When calling Popover: InfoView *iv = InfoView alloc initWithNibName:@"InfoView" bundle:nil; UINavigationController *uc = UINavigationController alloc initWithRootViewController:iv; self. Pop = UIPopoverController alloc initWithContentViewController:uc; self. Pop setDelegate:self; self.

Pop presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:true; It should look like this: iphone ios cocoa-touch uikit uipopovercontroller link|improve this question edited Feb 11 at 18:13Till6,98131033 asked Feb 11 at 17:14rakete408213 92% accept rate.

Rayfleck, you can also use it on the iPhone! Did you read the question and look at the picture? Don't be to premature.

– rakete Feb 11 at 17:34 stackoverflow.com/questions/6371508/… -- Is that what you're looking for? – Jackson Feb 11 at 17:39 2 @rakete - yes I saw the picture, and was confused by it. The iOS 5.0 library UIPopoverController class reference says: Popover controllers are for use exclusively on iPad devices.

Attempting to create one on other devices results in an exception. – Rayfleck Feb 11 at 20:07.

At first UINavigationController doesn't have own background, it shows background of content view controller. If you can show popover with navigation controller successfully, then check your InfoView. Does it's view has some background?

Second, I tried to execute your code multiple times in different configurations on iPhone, but always have received error Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-UIPopoverController initWithContentViewController: called when not running under UIUserInterfaceIdiomPad. And that was not surprise for me. Even if you could make it work, then Apple may reject your application.

2.1 Apps that crash will be rejected - Just test your code on several devices and see result.

I don't need the background of the content. I want to show the background of the bar, which includes the title and the buttons on the top of the navigation controller. You get this error because you have to override a method of the UIPopoverController-Class.

Unfortunetly I can't say you which, because at the moment I have no access to the code. – rakete Feb 20 at 10:46.

Your code InfoView *iv = InfoView alloc initWithNibName:@"InfoView" bundle:nil; UINavigationController *uc = UINavigationController alloc initWithRootViewController:iv; self. Pop = UIPopoverController alloc initWithContentViewController:uc; self. Pop setDelegate:self; self.

Pop presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:true; is perfect just hide the default navigation controller and add a navigationBar in the XIB of InfoView. Xib and write the cancelButtonAction there to perform the dismissal of the view or the detail of the tableview selection. It Works fine, Please check the image I have done the same way, and believe me it works fine.

1 Thanks. Now I see a navigation bar. But it have the standard blue background.

I want to the navigation "integrated" in the gradient of the border of the popover. – rakete Feb 20 at 17:51 You can alter the gradient of type you wish. Choose your navigation bar style as UIBarStyleDefault, UIBarStyleBlack, UIBarStyleBlackOpaque.

Also you can alter the color of the bar as well. – Meet Feb 21 at 4:19.

Add this to your code before the line self. Pop presentPopoverFromBarButtonItem:se..: uc. ModalPresentationStyle = UIModalPresentationCurrentContext; See the documentation for the modalPresentationStyle property.

Thank you for your anweser. But unfortunely the background is still invisible. – rakete Feb 19 at 21:56.

I think you'll need to paste in more of the code for your InfoView controller, as I suspect that's where the problem is.

There is no more code. – rakete Feb 11 at 17:32 1 Then that's where the problem is ;) – rokjarc Feb 15 at 23:32 Thank you for this helpful answer! Which code do you expect?

– rakete Feb 18 at 15:12.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions