增加 UISearchDisplayController PopOver 结果的宽度
我有一个 iPad 应用程序,其导航栏中有一个 UISearchBar。当我在搜索栏中输入文本时,结果会自动显示在 UIPopOverController 中。这很好,只是弹出窗口的默认大小不足以满足我的需要。有没有办法设置它的宽度?
Apple 自己已经通过 Safari 的搜索栏做到了这一点。显示搜索结果的弹出窗口比默认的要宽一些,并且他们已从弹出窗口中删除了“结果”标题。
I have an iPad app that has a UISearchBar in its navigation bar. When I enter text in the search bar the results are automatically displayed in a UIPopOverController. That's great except the popover's default size is not wide enough for my needs. Is there a way to set its width?
Apple has done this themselves with Safari's search bar. The popover that displays search results is a good bit wider than the default and they have removed the "Results" title from the popover.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要设置弹出窗口中显示的
UIViewController
的contentSizeForViewInPopover
属性。我不知道如果这一切都是在幕后自动发生的,你是如何做到这一点的。You'd need to set the
contentSizeForViewInPopover
property of theUIViewController
that's being displayed in the popover. I'm not sure how you get to that if it's all automagically happening behind the scenes.