首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >UISearchController的错位

UISearchController的错位
EN

Stack Overflow用户
提问于 2014-12-14 16:28:43
回答 1查看 895关注 0票数 0

我的UISearchController有问题。我不能正确地将它与tableView联系起来。

成果表未涵盖主表的整个领域:

代码语言:javascript
复制
resultsTableController = ScuoleSearchResultsTableController()
resultsTableController.tableView.delegate = self
searchController = UISearchController(searchResultsController: resultsTableController)
searchController.searchResultsUpdater = self
searchController.searchBar.sizeToFit()
tableView.tableHeaderView = searchController.searchBar
searchController.delegate = self
searchController.dimsBackgroundDuringPresentation = true // default is YES
searchController.searchBar.delegate = self    // so we can monitor text changes + others
// Search is now just presenting a view controller. As such, normal view controller
// presentation semantics apply. Namely that presentation will walk up the view controller
// hierarchy until it finds the root view controller or one that defines a presentation context.
definesPresentationContext = true
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-12-15 11:18:26

信不信由你,我只是通过标记UINavigationController设置来解决问题:

代码语言:javascript
复制
UINavigationBar.translucent = true

谢谢你的回复

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27471345

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档