I see there is UINavigationController as masterView in UISplitView.And the detailView has a UIToolBar at most but isn't base on UINavigationController.
So I would like to make the detailview base on UINavigaionController then I can pushViewController to show other controllers.
Can somebody show me how to implement?
You can add a UINavigaionController in your detail view class. Then, create the view by UINavigaionController and add to your detial view class.
Related
I want to show full screen view controller from UISplitViewController detail view controller. But I want UITabBar still to be visible. When I presentViewController it will hide my UITabBar. Can anyone suggest me the flow?
You don't have to nest your UIViewController in a UINavigationController.
Then instead of
[someViewController presentViewController: anotherViewController];
you have to call
[someNavigationController presentViewController:anotherViewController];
this will do the trick.
Note that it will add the anotherViewController at the top of the stack of viewControllers.
to remove it just call dismissViewController on the navigation controller!
I have a storyboard as seen in this picture:
From a table view cell, I modally present a new view controller which is a subclass of UITableViewController. In the scene on the RHS I have a UINavigationBar. But when my view is presented, it does not have it. Why is that? Thanks!
You'll need to embed your subclass of UITableViewController that you want presented modally inside of a UINavigationController.
To do this, click the view you want presented modally in your Storyboard, then go to Editor>Embed In>Navigation Controller.
I am using UINavigationController to push and pop other UIViewControllers in my app.
In one of the UIViewControllers I am using UITabBar to switch between different views. One of the view has UITableView and I am having difficulty showing the tabBar at the bottom. Even if it shows up it scrolls up and down with the tableCells.
I didn't use the tabbarcontroller because apple documentation recommends not to push tabbarcontroller on to navigationcontroller stack.
Thank you.
I guess that you are using UITableViewController. The View of the UITableViewController is the tableView itself, so when you add the tab bar to the view you actually add it to the table view. that is why it scrolls with it.
you should create a regular UIView, and then add the tableView and the tab bar to that view.
shani
I created "New Project" -> Tab Bar Application.
Then i changed from #interface FirstViewController : UIViewController to #interface FirstViewController : UINavigationController.
Then i changed file's owner from UIViewController to UINavigationController in xib file.
Then i updated view. But i don't see any label on the screen. Why? (i have some labels on xib)
Why are you subclassing UINavigationController and what are you trying to accomplish? UINavigationController does not display a view of it's own, just the navigation bar over some other view controller's view. In addition UINavigationController was not designed to be subclasses, hence the "This class is not intended for subclassing." warning in its class reference.
If you want to display your view controller as part of a navigation stack you should create an instance of UINavigationController, set that navigation controller as the view controller for one of your tabs, and then push an instance of your FirstViewController onto the UINavigationController.
I have a uiview class and i want to switch to other uiview class but without using addsubview
is there any other way to do that except the one (addSubView)
If you have UIViewControllers for the corresponding UIViews, and have a UINavigationController to handle your view flow, you can use pushViewController message at the mentioned navigation controller.
Since you have a navigation controller you can use pushViewController:animated to add anotherViewController to the navigation stack. You can also use presentModalViewController:animated. The section on Navigation Controllers in View Controller Programming Guide explains this very well.