views:

35

answers:

1

Currently the code I need to modify uses a tabBarController with a single selection inside it which takes the user back to the root view, but because it is a tabBar then the whole of the tab is selectable and I need it so only the button positioned in the middle of the tab bar is selected.

I am fairly new to this but know it is not a tabBar that is needed here but something else, maybe just place a button there. Any help would be fantastic. I would post the code up but I am unsure which section would be required. I hope I made myself clear enough :)

Rowley

A: 

Tab bars are for switching among different views. If all you want is a home button, a tab bar would not be a good choice. You could use either a simple UIButton, or possibly a tool bar -- though the tool bar is generally used when there is more than one action the user might take.

William Jockusch
Thanks for the reply, that's exactly what I thought the problem might be. I think a quick solution to the problem is to add 2 more tab bar items as well as the one that is already there to the right and left but when tapped they don't do anything. Is this idea even possible and if so how do I go about achieving this?
SamRowley
I really wouldn't suggest a tab bar for your situation. A tab bar is for switching among views. You can think of it as radio buttons. If a tab is already selected (which it would be in your case), and the user taps it, it doesn't do anything as it is already selected.Your home button is more of an action-style button. So I would really suggest either a toolbar or a UIButton.
William Jockusch
As an exception to the above, if you are planning on having the user be able to switch among views, and each tab calls up a different view, then a tab bar would be appropriate.
William Jockusch
Hey thanks for the advice, but the way the code was written before me meant a lot of work would have gone into just changing it to a button, I got it working by adding another tab but disabling it and seems to work fine and looks nice so I won't mess with it any more. Thanks again for your help.
SamRowley