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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-15-2010, 04:31 AM   #6 (permalink)
swarnalata
Registered Member
 
Join Date: Jun 2010
Posts: 1
swarnalata is on a distinguished road
Default Disabele/Hide of UIBarButtonItem

Hi,
suppose you have a done button of UIBarButtonItem and u want to hide it and show it programmatically depends upon your requirement.so you have do like following...

To Hide:

Declaration

UIBarButtonItem *donebutton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemD one target:self action:@selector(ondoneButtonPressed)];

self.navigationItem.rightBarButtonItem = donebutton;

for hide:

self.navigationItem.rightBarButtonItem = nil;

To Show:simply call
self.navigationItem.rightBarButtonItem = donebutton;

It will work for UIBarButtonItem , donebutton.hidden=YES will not work.
You can enable/disable by simply writing donebutton.enable=YES/NO.

Do not know about in which iphone environment for u r working but the given code will work for hiding and showing the UIBarButton for requirements in ur program.

swarnalata

Last edited by swarnalata; 06-15-2010 at 04:34 AM.
swarnalata is offline   Reply With Quote
 

» Advertisements
» Online Users: 486
16 members and 470 guests
baja_yu, brainspoon, comicool, Davor, Domele, eski, fredbmm, habitatus, hongto24, john love, MattW, m_rozzi, Newbie123, RickSDK, teebee74, txnhome
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,551
Threads: 94,078
Posts: 402,725
Top Poster: BrianSlick (7,990)
Welcome to our newest member, hongto24
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:09 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.