Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-18-2009, 04:34 PM   #1 (permalink)
New Member
 
Join Date: Dec 2008
Posts: 4
Question UITabBarController Enable/Disable Tab Bar Items or Entire Controller?

Hello All,
I am writing an app that has both tab bar and navigation controllers. Currently it is all working as I expect it to, each tab bar item launches the appropriate navigation controller...

I am at a point at which I need to introduce a view that all users need to see before being able to select the items on the tab bar. It is kind of like a EULA/FYI piece of information that I only want to show once when the user initially launches the app.

I am stumped on how to do this programatically. I have googled and looked searched through google code search to find examples and I haven't found much. What I have been able to do is through interface builder I can go to my tab bar controller and then double click on a tab bar item and in inspector I can modify the 'Enabled' option which will enables/disables the tab bar item. But I want to be able to do this programatically? Any ideas?

I have also thought of having a different view load before the view that loads the tab bar. Doing this could solve my problem, but it just doesn't seem as pretty/simple/correct. On this same note, could I overlay a view on top of the view that has the tab bar controller that they could just select a button on and it would go back to the tab bar controller?

Hopefully what I am trying to do isn't silly or impossible...

Thanks for your help,

HAiRY
HAiRYANiMAL is offline   Reply With Quote
Old 06-28-2009, 09:31 AM   #2 (permalink)
New Member
 
Join Date: Jun 2009
Posts: 4
Default

Hi, I'm in the same dilemma, did you find a solution or workaround?
rat10nal is offline   Reply With Quote
Old 06-28-2009, 11:49 AM   #3 (permalink)
New Member
 
Join Date: Dec 2008
Posts: 4
Default

I never found a solution. Good luck
HAiRYANiMAL is offline   Reply With Quote
Old 06-28-2009, 12:27 PM   #4 (permalink)
Registered Member
 
Join Date: Mar 2009
Location: Toronto, ON
Posts: 111
Default

Check out NSUserDefaults. On app launch you just check a key you have set for whether the user has ever seen the view before. If the key is NULL thn show the view. When the user clicks OK you just remove the view and replace it with your navigationcontroller view. Good luck.
CanadaDev is offline   Reply With Quote
Old 12-16-2009, 12:04 AM   #5 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 58
Default

Here's my solution:
I just draw a subview in front of the tab bar.
I'm sure the measurements aren't 100% correct, but they do the job ok.


Code:
//to disable the tab bar
CGRect stopRect = CGRectMake(0, 432, 320, 46);
UIButton *stopper = [[UIButton alloc] initWithFrame:stopRect];
stopper.backgroundColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:.3];
stopper.tag = 2000;
[appDelegate.window addSubview:stopper];
[stopper release];

...

//to enable the tab bar
[[appDelegate.window viewWithTag:2000] removeFromSuperview];
Hope this helps!
ziophase is offline   Reply With Quote
Reply

Bookmarks

Tags
disable, enable, uitabbarcontroller, view

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,767
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:06 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0