gpt4 book ai didi

iphone - UISearchBar inputAccessoryView

转载 作者:太空狗 更新时间:2023-10-30 03:56:37 25 4
gpt4 key购买 nike

UISearchBar 似乎将 inputAccessoryView 作为 readOnly 属性。如何使用我自己的 customToolbar 进行设置?

最佳答案

编辑:如以下评论中所述,这不再是 iOS 6 后的问题。请参阅 UISearchBar 文档 here .


UIResponder(UISearchBar 是其间接子类)class documentation详细说明实现此目的的方法:

Subclasses that want to attach custom controls to either a system-supplied input view (such as the keyboard) or a custom input view (one you provide in the inputView property) should redeclare this property as readwrite and use it to manage their custom accessory view. When the receiver subsequently becomes the first responder, the responder infrastructure attaches the view to the appropriate input view before displaying it.

例如

@interface CustomSearchBar : UISearchBar
@property (readwrite, retain) UIView *inputAccessoryView;
@end

关于iphone - UISearchBar inputAccessoryView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7058133/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com