开发者

iPhone: UIBarButtonItem as first responder?

开发者 https://www.devze.com 2023-04-09 06:09 出处:网络
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

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 but开发者_开发技巧ton (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?

0

精彩评论

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

关注公众号