iOS tab bar issue - ios

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..

Related

Tabs on Tab Bar Controller iOS doesn't work?

I am trying to make a segue from the tabs on the Tab Bar Controller. But I cannot attach them to anything! What am I doing wrong?
If I click on the tab bars (I have 2), none of them updated the current view displayed.
Also, how can I customize their widths? I want each to take up 50% of the bar; unlike here:

Hiding tab bar items on xcode

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];

Xcode - replace navigation bar with toolbar on show segue

This is what I wish to do.
---- Segue : show ---->
on the destination page, I want to hide the tab bar from the previous page and show the toolbar instead.
When I check "Hide bottom bar on push" on storyboard, the tool bar on the destination page disappears as well.
I think you should change the title of your question since you want to replace the tabBar with a toolBar and keep the navigationBar. At leas this is what I understand from your sketch.
As for the question, have you tried hiding the tabBar in viewWillDisappear in your first view?

make tabbar button as unselected when clicked on the navigation bar button

i am facing the problem with the tab bar,when i clicked on navigation bar button,the tab bar button is should be unselected,i tried but failed to do that.can any one help me to resolve the issue.
If i understood your needs, I guess what you want to do is to select no item at all in your tabbar.
So doing :
[tabBar setSelectedItem:nil];
should be what you need.
That is only if your tabBar is not handled by a UItabBarController. Else you'll get the following exception.
Directly modifying a tab bar managed by a tab bar controller is not allowed.
This behavior is unfortunately logical if you read the doc on the tabBar property of a UItabBarController : UITabBarController documentation - tabBar
You should never attempt to manipulate the UITabBar object itself stored in this property. If you attempt to do so, the tab bar view throws an exception. To configure the items for your tab bar interface, you should instead assign one or more custom view controllers to the viewControllers property. The tab bar collects the needed tab bar items from the view controllers you specify.
And reading through this page you'll see that UITabBarController gives you no means of selecting an item other than the ones on your tabBar (except the moreNavigationController UITabBarController documentation - moreNavigationController )
EDIT : If you do want to keep your tabBar shown, you can trick the users and make them believe the tab is unselected by applying the "unselected style" to the selected tab. This question should give you everything you need to do that : How to change inactive icon/text color on tab bar?

how can i hide a tab on the tab bar in iphone

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;

Resources