Add a UIView before UINavigation - iphone

I have created a navigation based application.
I need to add a UIView before the navigation with the company details and have user to click on a button to enter the UINavigation view.
How can i do that?
Thanks.

Make the UINavigation's viewdidload show a modal viewcontroller, and give the viewcontroller a button to dismiss it.

You can add that UIView directly to the UIWindow, i.e. [self.window addSubview:self.myView]; and as you done with that UIView(after clicking on button), simply remove it from UIWindow and add UINavigationView to UIWindow.

Related

It is possible to add TabBarController to a subview?

I am developing a new application. In my application it required firstly signing and registration page. After that it will show tab bar controller. So is it possible to add tabBarController in thirdView without using presentModelViewController?
You normally create your UITabBarController, fill in the desired viewcontrollers
for example you have a UITabBarController called tabBar
you can add tabBar.view to any UIView
[self.view addSubView:tabBar.view];

How to add a UIViewController as a subview to a UIViewController(RootViewController)?

I have a UIViewController named LoginViewController, and it is a rootViewController in the AppDelegate. In the LoginViewController, I have two buttons: Login and Enroll.
When I tap Login, I assign a TabBarController as the rootViewController, then show the TabBarController. However, now I think I need to add another UIViewcController as a subview when I tap Enroll. I tried the following:
[self.view addsubview:viewcontroller.view];
But the problem here is My ViewController's view.top is pinned about 20 pixels below the top of the screen. I think there is an issue with the status bar, but I can't figure out how to fix it.
I think that I need to add my ViewController as a subview to the LoginViewController, then redirect from there to different views. Can someone please suggest other options?
Try to set frame to your enroll screen object then add it as a subview to loginview.
Ex:
[enrollViewcontroller.view setFrame:CGRectMake(0,0,320,440)];
[self.view addsubview:enrollViewcontroller.view];
You should not make a UIViewController a subview of another UIViewController's view. What you likely want to do if treat the subview as a normal UIView (if not both of those views) so that you only have one UIViewController on screen and it occupies the entire screen.
More here: How to add an UIViewController's view as subview
Instead of adding a UIViewController as a subview to another UIViewController, I have decided to present my ViewController as a ModalViewController using
[self presentModalViewController:myViewController animated:YES];

UIWindow doesnt allow me to see my UIToolBar

I am in a situation where I'm customizing a existing project.
When trying to create a UIToolBar in Interface Builder it appears.
Once I press Run and Build and the app runs, There is just a blank screen.
Any ideas on how I can get the UIToolbar to appear in the foreground.
Any help is appreciated
Without looking at some code, there are many reasons why it would not show up. My best guess is that you are not actually loading the UIView that you think you are loading. Have you set the Outlets for the UIViewController's view? Are you adding the new view to an existing view with [view addSubview:newView]? IS the Tabbar nested (a child) of the new view in IB or is it on the same level?
You can add code in your AppDelegate to add the UIToolbar subview to your window.
[self.window addSubview:toolbarName];
If customizing the toolbar in IB, you can still do this, just add the toolbar to your AppDelegate as an IBOutlet and connect it in IB.

iPhone Dev - Is it possible to remove a button from a UINavigationController's navigationBar?

When I push a view via my app's navigationController, it automatically puts a back button on the left side of the navigationBar. Is there any way I can just remove this? (I want to put my own buttons on the screen that will allow the view to be popped).
From the comments, you can hide the back button for a viewController by using its navigationItem property. (which is the UINavigationItem corresponding to that viewController in the stack of the navigationController. its how you control what shows up on the bar for specific view controllers (see Apple Doc here)).
To answer your question, set the navigationItem's hidesBackButton property to YES. Something like this probably called in your viewControllers viewDidLoad: or similar method.
myViewController.navigationItem.hidesBackButton = YES;
have you try with self.navigationItem.hidesBackButton=YES;?
If I wanted to do it, I'd hide the Navigation bar on push (non animated hide), add a toolbar, and add any custom stuff I want to the toolbar.
on popping the view controller, make sure to unhide the navigation bar. It'll work

Split view controller menu in w/o split view controller?

I am making an iPad app, and am wondering it is possible to get the pop down menu from a UINavigationBar without having to go through the trouble of a split view controller. Is this possible? Tell me if I'm not being specific enough.
Yes, you can do that without much trouble, but you just have to write the code. Just display a UIPopoverController from that UIBarButtonItem on your navBar.
The steps:
Create a UIViewController which manages a table view (or whatever else you want) as your menu view controller.
Add a UIBarButtonItem to your nav bar or toolbar.
Create an IBAction to called something like touchedMenuButton.
Connect that action to that UIBarButtonItem.
In that method, alloc/init that view controller.
alloc/init a UIPopoverController with that view controller.
present that popover from the UIBarButton item
Success!