tags:

views:

317

answers:

2

hi i have created a bar button which displays Done when the editing of the text view starts. what actually i need that when i press the done button then the the editable property of textview will become false and the done button hides.

i am done with the first part but how to hide the bar button?

please help..

+1  A: 

You can disable it (it becomes dim):

//assuming it's the right one
[[[myNavigationBar topItem]rightBarButtonItem]setEnabled: NO];

I think to hide it, you actually have to set it nil. Then recreate it when you need it.

[[myNavigationBar topItem]setRightBarButtonItem:nil animated:NO];
christo16
I think your answer is better; if it's a predefined system button, then they're just floating around as constants anyway.
saramah
A: 

If it was just a UIButton, I'd say you can do something like this:

myButton.hidden = YES;

But if it's a UIBarButtonItem, you could try the solution here. Let us know if it works!

saramah