I'm in the process of making an app that has a UITabBar at the bottom of it. I want to make an "Enter screen." Basically, when the app starts up, right now the enter screen appears, but the tab bar still shows at the bottom. So if the user presses a tab on the tabbar..and then goes back to the first screen, the enter button is still there. Anybody know a good way around this? I was gonna try to have it so that if the user selected another tab, the enter screen would just go away. Either that or just to have a full screen view over everything and then when enter is pressed, have it close to full screen view. Although, I don't really know how to go about doing either of those. Any ideas?
Chris
You can use the method -viewWillAppear on your UIViewController subclass to hide your enter screen. It is called every time a tab is selected, on the new tab, just before it is displayed.
If I understand correctly... you just want a title screen when your app starts up that never shows again during that session?
If so, just create a file that is a 320x480 image of what you want the screen to look like... save it as a PNG, and name it Default.png.
This image will be shown while your app is loading, and then will disappear when your app is ready to go. No tab bar will show, and you won't need to mess with disposing of any extra ViewControllers.
Related
I have four UITabBarItem's. Each has a label and custom icon. My AppDelegate uses the UITabBarDelegate protocol and every click on a tabbaritem is logged to the console so I can see what is happening.
The only way to select a tabbaritem is to click on the label. If I click anywhere else on the button area, including the icon, nothing happens at all.
Have you come across anything similar?
Well, I found the issue. Whenever a tab was clicked and a new view was programatically inserted, that view was placed on top of the tabbar, but since it's background was transparent I could not see it. So half of the tab bar was covered by another view. By making sure to bringSubviewToFront: the problem could be solved. Thank you everyone who tried to help.
I'm wondering if it is possible to start my app with all my tabs in the "up" state and show a "landing" view to the user. Kind of like a welcome/quick start. When they select one of the tabs, it switches views as normal.
Will you point me in the right direction?
Kind of like this:
If you're using a UITabBar/UITabBarController, I think you must have the selectedIndex set to some legal value. I don't think this is possible, nor can I find an app on my iPhone or iPod that mimics the behaviour you're looking for.
(The App Store app is as close as it gets, where it looks like it has an empty tab bar before it loads data from the Internet, but it could very well be that they are just re-using the Default.png and superimposing an activity indicator during loading.)
Note that if you tried to submit your app to Apple, they could easily reject it for using non-standard UI.
The way I would probably do this is to create a new ViewController that's just for this screen, but make sure it's last in the viewControllers array managed by the UITabBarController. That way, when you show the tab bar on the screen, you get the 4 tabs and the more button, but the currently selected view controller is not in the bar, meaning that all of the other tabs are unselected.
Once the user has satisfied the condition for showing the screen, you can discretely remove the view controller from the tab bar, and the user will never be the wiser.
I'm writing an app that has a 5 item TabBar. When launching, I want the app to show the contents of the view for the first item, without showing the Tabbar. I want a hidden button to cover the full screen so that when I tap anywhere the TabBar pops up from the bottom. I then want it to hide itself again after a few seconds.
I guess it isn't vital that it not show the TabBar on launch if it will hide itself after the predetermined time frame.
I'm new to programming, and I'm having difficulty making this happen. I've looked at the suggestions for similar questions, but they don't seem to help. Any suggestions for making this happen?
Look at the example code "The Elements". It hides the tab bar when you select an element.
I am developing a application in which I need to provide navigate to backward screen programmatically, in which there are two scenarios:
There will one MainWindow.xib and few buttons on it, click of any one button will load another appropriate screen. On this screen, I need to put back button, click of which will load MainWindow.xib again and user can choose some other option.
Except the above scenario, also all the screens will contain back button, click of which will load the previous again and user can choose some other option.
Regards,
Pratik
You want to use the UINavigationController for this. See the link for the documentation and example projects. I can't really give a full example here, but you can get started with the "Navigation-Based Application" template in XCode.
The general idea is that you push and pop views to/from a UINavigationController, and it will handle the back button and navigation toolbar for you. It's pretty straight forward.
I have a few different views in my App, all of which are viewed by tapping different buttons. All the buttons work on the simulator, but when I run the app on the device only one button does not work. I went over and over my code and re coded that one button and re-connected it in IB to make sure that i did not mess something dumb up, but it still freezes my app.
When the bad button is tapped the App will freeze but not shut off and the only way to unfreeze it is to press the home button.
Any thoughts on why this might be happing only to this one button?
I got it! It was something really dumb! In the view that is loaded when the button is tapped there is a picker. What was happening is that I have a BOOL value that needs to be set to true when the button is tapped and I forgot to set it. Without that BOOL value being set the picker was not being loaded the right way.