I'm developing an iPhone application that have a TabBarController with two tabs.
Each tab contains a UIWebView that loads a web page from my web site.
I want to add a view that will function as a welcome screen that doesn't show the TabBarController itself (full screen view) and indicates that the application is being loaded.
After that I want to hide the welcome screen and show the TabBarController
Can anyone point me to the right direction on how to implement this functionality?
Thanks!
I would suggest using a modal view controller for the loading view:
- (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated
If you present the modal view controller as soon as your app launches (with no animation), it will be on top of everything, including the tab bar, even if it was presented by one of the tab view controllers.
Once the loading is done, you can dismiss the modal view controller:
- (void)dismissModalViewControllerAnimated:(BOOL)animated
You could animate the dismissal or not.
If your Default.png (launch screenshot) looks like the modal view, the whole thing should be pretty seamless.
Related
I have an iphone app consisting of a tabbar controller in the main.xib, where the tab bar controller contains navigation controllers, which are associated with corresponding view controllers. I assume this is pretty standard.
If I present a modal view controllers view from a navigation controller contained in this hierarchy, the view owned by this view controller pops up as you would expect. However, Ive noticed if I have controls (such as a button) at the very bottom of this 'modally presented' view it is rarely detecting taps. It seems as though the tabset underneath is blocking the touches. Note that when I present the modal view controllers view it fills the visible screen, it isn't sliding up from underneath the tab set.
I thought this tababar controller->navigation controller hierarchy was pretty standard, shouldn't I be able to present a modal view controller from a navigation controller in this set up without issue? I have also tried to present the modal view controller from the tab bar controller, with the same effect.
How do I present a modal view controller in an app with the tabbar controller->navigation controller hierarchy such that the lowest portion of that view can detect touches?
thanks for any help!
Check out the first answer by Harry, I believe this set-up is related to your situation. Post an update and let us know if this helps: UIView doesn't resize to full screen when hiding the nav bar & tab bar
Also, what code are you using to present the modal view?
I'm working on an app that requires a pushing a view that is full screen and shows/hides status, navigation and bottom toolbars on tapping of the central image. The app currently has a UITabBarController that has a UINavigationController for each tab. Basically when the full screen view is displayed I want it to to work like the photos app and animate off the tab bar to show my full screen view.
I'm having trouble making the view take up the full screen if I manually animate out (down) or hide the tabbar.
So, in a nutshell, my question is - what is the view hierarchy of the photos app?
It must have a base navigation controller, that contains a tab bar controller. But does each tab contain another navigation controller? But if so, how to they seem to share the navigation bar with the root navigation controller (look at how the back buttons etc are animated in)?
Is there something really obvious I'm missing?
Thanks for any help.
Have you tried using UIViewController's hidesBottomBarWhenPushed property?
I'm reading a book called Beginning iPhone 3 Developement - Exploring the iPhone SDK, by Dave Mark and Jeff LaMarche. I've read about navigation controllers and multiview applications, and now I want to create my own little app, a very simple Twitter app. I want a login view, and if the login is successful I want the user to be presented a view with a tab bar, where each tab is Update, Timeline and such. Right now I'm just going for the update view.
So I thought about a navigation-based app. The first view, the login view, is on the bottom of the stack. When the user logs in, the view with the tab bar is pushed on to the stack. Then the user does whatever (s)he wants there, in the tabs. (S)he should then be able to press some kind of logout button, which pops the tab bar view off the stack, and takes the user back to the login view.
Now to my question (sorry for my long explanation): is this the way to go? If so, how do I do it? Do I create a view controller called LoginViewController, which is subclassing UINavigationController, or what?
From a UI perspective, a more fluid design might use a modal view controller.
A modal view controller pops up from the bottom of the screen and displays its own view. When this view is dismissed, it shuffles down and disappears.
In my opinion, a modal controller is a good place for a transient authentication screen — you just bring it in view, the user enters his or her info, and the view is dismissed.
On returning to the parent view controller, it checks the authentication credentials and modifies its view if authenticated (or not).
Another advantage of the modal view controller is that it is on its own navigation stack. So you don't need to push a controller, pop up and then push a different view controller. It makes for cleaner code and a cleaner interface (again, in my opinion).
I have a hidden UITabBarController but it seems to cover up the buttons that I'd like to place at the bottom edge of the screen in the home view.
// hide the tabBar for the home screen
- (void) viewWillAppear:(BOOL)animated
{
self.tabBarController.tabBar.hidden = YES;
}
Is there a way around this? The tab bar will be shown for the other views except for the home view (i.e. the first tab).
Cheers!
What you could do is in Interface Builder (assuming you added the UITabBarController from within IB) choose from the Menu: Layout --> Send To Back while the TabBar is highlighted. This would mean that on the "home" view it would would not obscure the buttons and on the other views it would be at the front, assuming you have no other buttons located at the same position in the UIView in your other views.
It would, of course, be cleaner to Load a new view controller when you navigate away from the home view, and invoke the UITabBar at that point, so that you don't have to resort to this kind of UI trickery.
i.e. your home view and your other screens (with the UITabBar) would be in two different XIBs.
I have a small multiview app. It consists of a UITabBarController with a nav controller in each tab. What I want is to show a UIImageView when a user shakes the device. After I've implemented the loading of the UIImageView, I faced a problem-the image was only 2/3 of the screen because of the tab and nav bars. I managed to hide the nav bar but I'm still stuck with the tab bar. I tried many solutions such as [tabBar setHidden: YES]; but I get errors "tabBar undeclared", although I've imported the AppDelegate, where the tabBar was defined.
Thanks in advance!
Try setting
myViewController.hidesBottomBarWhenPushed = YES;
when you create your UIImageView. When you push it on to the view stack the UITabBar will hide automatically, and it will be restored automatically when you pop or dismiss the controller. No need for the application delegate.
If you want to show a full screen view, it is best to use a modal view controller. This way you do have to worry about hiding/showing navigation items. Take a look at:
http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/ModalViewControllers/ModalViewControllers.html
to get started.