i'm working on an iphone project and i have to show a login view and after log in i have to show a tab bar, all the tabs show different views and all the views have controls that link to other views. so i was wondering what can i do about it, first i was thinking to work with a navigation controller but while reading some posts they suggest not to work with a navigation that includes a tab bar controller. so, i think i can work with a tab bar controller and the first tab should be the login tab but i need to hide the tab bar from the view while logging in and after that i can show the tab bar with the other tabs. i don't know if it's possible. that's why i need your help. thanks in advance
You only need to set the property "hidesBottomBarWhenPushed" to YES. like..
mTSProjVC.hidesBottomBarWhenPushed =YES;
Related
Ok, my experience with tab bar controllers is limited but Ive never encountered this issue. I am able to create a tab bar controller but not add a tab bar or tab bar item tp it. I have followed this : https://makeapppie.com/2015/01/27/tab-bar-controllers-in-storyboards/ and others exactly and they just say to drag in the tab bar controller or embed another VC in it and boom - tab bar.
This is what has happened for me:
The tab bar is grayed out and Im not able to drag a tab bar onto the VC or anywhere. What am I doing wrong here? I need to migrate my standalone VCs into a tab bar controller.
make sure to your relationships between view controllers and view controller
this is my tabbarcontroller
If you've only ever used a tab bar controller and not a tab bar on its own, then don't close this or mark it as a duplicate based upon your presumptions and assumptions.
I've added a tab bar to a view controller and now want to connect the tab bar with the view controllers that will be selected via it.
I've done this sort of thing many, many times before using a tab bar controller and assumed it would be just as straightforward as but when a using just a tab bar but no - I just can't find or see any way of doing it. Tried adding tab bar items to the view controller and tried dragging between these and the tab bar, and between the tab bar and the tab bar items and to the view controllers. Millions of combinations and can't get it to work.
Googling or searching for past questions on this isn't as straightforward as you'd think - because the search results all come back involving the use of a tab bar controller, I can't see anything for just a tab bar which is part of a regular view controller.
I think, this is not possible using a storyboard. You should do this in code.
Or maybe hideBottomBarWhenPushed is what you are searching for.
Keep in mind with the following question, I am still an iOS noob.
So I understand how to hide/show/recolor the navigation bar and whatnot. My next challenge is that some screens need the nav bar and others do not.
When my app starts off, I have the nav bar as hidden and then the user can click register or log in (both of which screens have a nav bar).
So those screens have the code to show the nav bar all while the first (welcome screen) has the code to hide the nav bar.
Here is the question: Why is it that when I first start my app, the nav bar is not there, but when I go to register/login and then hit the back button to return to the welcome page (initial page) then the nav bar is still there, even though my code to hide it is in the viewDidLoad method?
How can I fix this?
You can try moving the logic of hidding the Nav bar to the ViewWillAppear method, you just need to override it in your View Controller class.
Alternatively I would suggest to use a separate view controller to handle your login/registration screens and only use nav bars where you need them. You would have to create a view controller in your story board with your regular screens and embed the screens that need the tab bar in a navigation controller, You can then segue from your regular view controller into the navigation controller that includes your tabs.
Hope this helps
So i have a tab bar controller linked to 4 different view controllers.
My first viewcontroller (First page that pops up during simulation) is my login page. I just want to hide the tab bar items before logging in and after the right login details have been entered re-enable the tab bar items to be accessible.
I have read other related questions in this site however i can't seem to find a simple solution. I thought the coding would be as easy as hiding images or labels.
any help will be great!
Try:
//To hide the tab bar
self.tabBar.hidden = YES;
//To disable tab bar item in tab bar controller
[[[[self.tabBarController tabBar]items]objectAtIndex:1]setEnabled:FALSE];
In my app i'v UITabbarController as rootviewController with 3 tabs on it, each tab has its own UINavigationController.On the first tab i'v attached a UIViewController that hides tab bar and navigation bar, by click on a button user can go to next screen that will show tab bar as well as navigation bar.Now the problem is when i click on first tab on this view controller (which is already selected by default) it takes me on previous view controller and i want it should stay on the same screen.How to achieve this?
Edit: I dont want to disable bar item at index 0 as this turns it into UIControlStateDisabled which make it different looks from others.
Is there any way to set image for UIControlStateDisabled for tab bar item?
Any help or suggestion would be appreciated.
Try this may be helpfull...
[[[[self.tabBarController tabBar]items]objectAtIndex:1]setEnabled:FALSE];
set "objectAtIndex" that you want..