简体   繁体   中英

iPhone: UIBarButtonItem as first responder?

Is it only classes inheriting from UIControl that can become "first responder"? I need a button in the navigation bar that brings up a UIPickerView using the inputView/inputAccessoryView properties. I know that I can use the customView property of the UIBarButtonItem and create a custom UIButton , but this would need "Photo Shopping" to create an image similar to the UIBarButtonItem "Done" style button (which is what I want).

Any suggestions how/if I can get UIBarButtonItem to become first responder?

Basically any class which inherits from UIResponder (not just UIControl, but also UIView subclasses) can become first responders, but UIBarButtonItem inherits from UIBarItem and NSObject. Hence it can not become the first responder.

Out of curiosity, what you are doing is not possible by just displaying the UIPickerView on a button press?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM