uinavigationcontroller interview questions
Top uinavigationcontroller frequently asked interview questions
I want to create an iPhone app that uses a navigation scene similar to the one pictured in the link
Please note I do not want this to only work for iPad, I want it to work for iPhone exactly as pictured, when you click on a tableview item it hides the tableview and makes that view full screen. I want ideas on how to do this because I cannot figure it out myself.
Thanks
Source: (StackOverflow)
Hey all. I'm still pretty new to iPhone development, and I'm having a bit of trouble figuring out how to change the title of my Navigation Bar. On another question on this site somebody recommended using :
viewController.title = @"title text";
but that isn't working for me...Do I need to add a UINavigationController to accomplish this? Or maybe just an outlet from my UIViewController subclass? If it helps, I defined the navigation bar in IB and I'm trying to set its title in my UIViewController subclass. This is another one of those simple things that gives me a headache. Putting self.title = @"title text"; in viewDidLoad
and initWithNibName
didn't work either. Anybody know what's happening and how to get it happening right?
Thanks!
Source: (StackOverflow)
I'm updating my app for iOS 7 and I discovered a weird problem. I'm presenting a UIViewController wrapped in a UINavigationController with UIModalTransitionStyleFlipHorizontal
.
In iOS 6 it works fine, but in iOS 7 the navigation bar bounces after the transition. Does this have something to do with the status bar? I've set translucency of the main navigation bar to NO
.
In the Info.plist, View controller-based status bar appearance is set to NO.
I've recorded a small video (MOV) to show my problem. And here is a GIF showing the same problem in a minimal demo app:
Here is my code:
feedNavigationController = [[UINavigationController alloc] init];
feedNavigationController.navigationBar.translucent = NO;
SettingsViewController *settingsVC = [[SettingsViewController alloc] init];
feedNavigationController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[feedNavigationController setViewControllers:[NSArray arrayWithObjects:settingsVC, nil]];
[self presentViewController:feedNavigationController animated:YES completion:nil];
Source: (StackOverflow)
I have a navigation based application and I want to change the animation of the push and pop animations. How would I do that?
Source: (StackOverflow)
I have the code below that hides and shows the navigational bar. It is hidden when the first view loads and then hidden when the "children" get called. Trouble is that I cannot find the event/action to trigger it to hide again when they get back to the root view....
I have a "test" button on the root page that manually does the action but it is not pretty and I want it to be automatic.
-(void)hideBar
{
self.navController.navigationBarHidden = YES;
}
-(void)showBar
{
self.navController.navigationBarHidden = NO;
}
Source: (StackOverflow)
In iOS 7 Apple added a new default navigation behavior. You can swipe from the left edge of the screen to go back on the navigation stack. But in my app, this behavior conflicts with my custom left menu. So, is it possible to disable this new gesture in UINavigationController?
Source: (StackOverflow)
In a UINavigationController-based iPhone app, in a method I would like to perform the programmatic equivalent of the back button being pressed and going back a view.
i.e. automatically press the Jobs button as seen here:
Is there a generic iOS call I can make, or is more information required?
Source: (StackOverflow)
I have a universal app, and on the iPad version I'm using UISplitViewController
to create an interface similar to the Mail app.
I was having trouble pushing new Detail views, so I decided to use a UINavigationController
so I could just push and pop views as needed. However, I do not want to use the navigation view or a toolbar. But no matter what I do, I can't hide the navigation bar.
I've tried unchecking "Shows Navigation Bar" in IB, and I've also tried setting:
[self.navigationController setNavigationBarHidden:YES];
in the viewDidLoad
/viewDidAppear
/viewWillAppear
. I've also tried it in each of the views that will be pushed. Nothing works.
Is there something I'm missing here? Is it possible to have a UINavigationController
without a toolbar or navigation bar?
Source: (StackOverflow)
Does anyone know how can I use my custom subclass of UINavigationBar
if I instantiate UINavigationController
programmatically (without IB)?
Drag a UINavigationController
in IB show me an under Navigation Bar and using Identity Inspectory I can change class type and set my own subclass of UINavigationBar
but programmatically I can't, navigationBar
property of Navigation Controller is readonly...
What should I do to customize the navigation bar programmatically? Is IB more "powerful" than "code"? I believed all that can be done in IB could be done also programmatically.
Source: (StackOverflow)
I have an application where I need to remove one view from the stack of a UINavigationController and replace it with another. The situation is that the first view creates an editable item and then replaces itself with an editor for the item. When I do the obvious solution within the first view:
MyEditViewController *mevc = [[MYEditViewController alloc] initWithGizmo: gizmo];
[self retain];
[self.navigationController popViewControllerAnimated: NO];
[self.navigationController pushViewController: mevc animated: YES];
[self release];
I get very strange behavior. Usually the editor view will appear, but if I try to use the back button on the nav bar I get extra screens, some blank, and some just screwed up. The title becomes random too. It is like the nav stack is completely hosed.
What would be a better approach to this problem?
Thanks,
Matt
Source: (StackOverflow)
I'm currently migrating my app on ios 7 and I've been stuck for hours on the new navigationcontroller/bar management.
Before, when we had a navigation controller, we had a snippet like this :
UINavigationController *navController = [[UINavigationController alloc]initWithRootViewController:[[MainViewController alloc]init]];
In interface builder, we had the choice to set an existing navigationbar for the view and everything match the content of the real view.
OK so now, i have no clue of how to design properly with interface builder.
I still have my snippet to initialize my navcontroller. However in the interface builder for my MainViewController if I set a status bar to translucent or opaque navigation bar, i have an offset of 44px at the top (see below).
Interface Builder_________________________And the result
Now, if i set status bar to none, there is no offset at top but since the view on simulator is smaller because of navigation bar the bottom of the view in interface builder is cut off.
Interface Builder_________________________And the result
I guess i'm really missing something here but i can't find any topic or apple info in iOS7 Transitions Guide about that.
Thanks for your help
EDIT
As we can see in the pictures, the first child of the view is a UIScrollView which contains both labels, the problem does not appear when there is no scrollview. It also appears if it's a UITableView.
If a label is outside the UIScrollView, there is no offset to that label.
Source: (StackOverflow)
Whenever a user begins editing a UISearchDisplayController
's search bar, the search controller becomes active and hides the view's navigation bar while presenting the search table view. Is it possible to prevent a UISearchDisplayController
from hiding the navigation bar without reimplementing it?
Source: (StackOverflow)
I have 2 seperate navigationcontrollers, one with RootViewController A and the other with RootViewController B.
I am able to push ViewController C onto either A or B's navigation stack.
Question: When I am in ViewController C, how can I find out if I am in the stack belonging to A or B?
Source: (StackOverflow)
How can I add 2 buttons into the UINavigationBar without XIB?
The 2 buttons should be aligned on the right side of the UINavigationBar.
I know how I can add one button, but how about two?
Source: (StackOverflow)
So, I push a view controller from RootViewController like:
[self.navigationController pushViewController:anotherViewController animated:YES] ;
BUT, FROM anotherViewController
now, I want to access the RootViewController again.
I'm trying
// (inside anotherViewController now)
///RootViewController *root = (RootViewController*)self.parentViewController ; // No.
// err
RootViewController *root = (RootViewController*)[self.navigationController.viewControllers objectAtIndex:0] ; // YES!! it works
I'm not sure WHY this works and I'm not sure if its the best way to do it. Can somebody comment on a better way to get the RootViewController from a controller you've pushed into that RootViewController's navigationController and whether or not the way I've done it is reliable or not?
Source: (StackOverflow)