简体   繁体   English

如何使UISearchController中的范围栏始终在iOS Swift中可见?

[英]How to make a scopebar in UISearchController always visible in Ios swift?

I want to implement functionality in my UISearchController , with ScopeBar , where I don't want my scope bar to be hidden. 我想使用ScopeBarUISearchController实现功能,我不想隐藏我的范围栏。 I want it to always be visible and functional. 我希望它始终可见并起作用。 Currently, it is visible on the first view load and then hides after search filter is applied. 当前,它在第一个视图加载时可见,然后在应用搜索过滤器后隐藏。 Then, going forward, it always becomes visible on a click of the search bar. 然后,继续前进,在单击搜索栏时它始终变得可见。

If you want the Scope Bar to always be visible, you may want to hook up a separate UISegmentedControl and not use the Scope Bar at all so you do not have to mess around with UISearchController's default behavior. 如果希望范围栏始终可见,则可能需要连接一个单独的UISegmentedControl而不使用范围栏,因此您不必弄乱UISearchController的默认行为。

Also, this question may help guide you to an answer. 另外, 这个问题可能会帮助您找到答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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