gabac
gabac

Reputation: 2078

Inactive UIBarButtonItem

Does someone know how the inactive done button in the Contacts App is done?

I would like to implement something similar.

So far I haven't seen any inactive property on UIBarButtonItem...

Upvotes: 0

Views: 704

Answers (1)

BoltClock
BoltClock

Reputation: 723944

Use the enabled property. Of course, you'll need to use your own validation checks on the input controls in your view controller, to determine whether or not to set it enabled.

// Assuming the Done button is on the right
[self.navigationItem.rightBarButtonItem setEnabled:NO]; // Disables the button

The enabled property is found in UIBarItem, the class from which UIBarButtonItem inherits, which is why you won't find it in the UIBarButtonItem docs.

Upvotes: 2

Related Questions