开发者

Inactive UIBarButtonItem

开发者 https://www.devze.com 2023-01-21 14:26 出处:网络
Does someone know how the inactive done button in the Co开发者_如何转开发ntacts App is done? I would like to implement something similar.

Does someone know how the inactive done button in the Co开发者_如何转开发ntacts App is done?

I would like to implement something similar.

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号