UIPopoverController position - iphone

I have a navigation bar in my app. I have to have 2 UIBarButtonItems next to each other, which i have put in a UIToolbar, and that UIToolbar is assigned as the rightBarButtonItem of my view controller like:
self.navigationItem.rightBarButtonItem = rightToolbarButtonItem
where the rightToolbarButtonItem is a toolbar, in turn having 2 buttons. Now, on clicking any of the bar buttons, i have to show a UIPopoverController. So i use:
presentPopoverFromBarButtonItem: permittedArrowDirections: animated:
But, in both cases, my popover arrow direction is the same. because it is taking the whole toolbar as a buttonItem. I want to show the arrow direction according to the bar button items in the toolbar.
Is there a way out?

I made it work by presenting the popover from rect instead of presenting it from barButtonItem and hardcoded the rects for both the barButtonItems.

Related

iPhone: more navigation controller in tabbar in container view

I'm working on a iPhone app with storyboard.
I need to put a TabbarController in a containerView like this:
The red rectangle in the controller on the left is a view I need to show always in the app.
I put 6 item in the tabbar so the tabbar show the "more" item.
When I tap on the "more" item I can normally customize the tabbar, but when I tap on "done" button nothing happens: the customization sheet don't disappear and I can't tap on the other items in the tabbar.
If I use the tabbar not in the containerView alla works fine.
Any help?
Thanks in advance!
Simone

How to add subview to UIViewController pushing UINavigationBar behind

What I want is as follows:
Basically I have a view controller with navigation bar. There is a menu button as left UINavigationBarItem. On click of menu button list of menu items will animate from top. This is achieved using 'addSubview' method. But menu list is added as subview below navigation bar. I want to add menu list view pushing navigation bar behind menu list view. I dont want to hide navigation bar.
Thanks
try:**[self.navigationController.view** addSubview:xxxView],this work to my app. Don't use [self.view addSubview:xxxView], that can't put the navigation bar behind.
Have you tried..? bringing your subview to front after adding the subview
//after adding your menu view
[self.view bringSubViewToFront:menuItemsView];
[self.view sendSubviewToBack:self.navigationController.navigationBar ];
I am not Sure but........ It may be not possible, because if You want to display your menu list behind your UINavigationBar then you need to hide your UINavigationBar without hidden UINavigationBar menu list will always display below the UINavigationBar.

UiNanigation Bar With background image and rightbarbutton item

i have added back ground image to UINavigationBar in drawrect method,image added properly.and also i added right bar button item to Navigation bar in View did load method.
my problem is i navigate to detail view and when i am coming back to rootview controller, right bar button item is not visible but button action working on navigation bar right side
Can Any one help to solve this
I would remove the background image. Apple engineers told me not to do this very thing. I would use the customise options in ios5 instead.

Bar with buttons under statusBar, UINavigationBar or UIToolBar?

I am looking to add a bar with buttons (buttons to fire actions, not for navigation) under the statusBar and above a custom UIView. My question is, I am not sure if I should be using UINavigationBar and adding UIBarButtonItem or if I should be using UIToolBar (which says it is used at the bottom of the screen) again adding UIBarButtonItem for the button?
You would usually use a UINavigationController for this and set the leftBarButtonItem and rightBarButtonItem of the navigationItem property of the view controller for the custom UIView.
Using UIToolbar is probably not what you want since it has a double border at the top, and a less visible border at the bottom, which would look weird in a toolbar at the top of the interface.

SegmentedControll in navigation bar hides view.title

I'm using a segmented control in the navigationbar in a tabbarcontroller app.
The problem is that after adding the segmented control to the navigation bar the title of my view disappears form the tabbarcontroller.
How do i work around this problem?
Try to add the segmented Control in the right or left side not in the middle. If you will add in the middle then it will hide the title label of navigation bar.
Oops my bad. Adding the UISegmentedControl to the navigationbar title does not make the title disappear in the tabbar. I set the title to nil by accident when finished parsing the webpage..