作者热门文章
- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我有一个管理 UISearchBar 和 UITableView 的 UIViewController。我读过 Apple 不鼓励让多个 UIViewController 管理你的应用程序的一部分,所以我没有使用 UITableViewController 来管理 UITableView。相反,我在自己的 UIViewController 中实现了 UITableViewDelegate
和 UITableViewDataSource
协议(protocol)。
我的问题是,由于我不再使用 UITableViewController,我该如何实际更改 clearsSelectionOnViewWillAppear
行为?此属性是 UITableViewController 的一部分。
最佳答案
只需调用
[myTableView deselectRowAtIndexPath:[myTableView indexPathForSelectedRow] animated:YES];
在您的 viewWillAppear:
方法中。
关于objective-c - 不使用 UITableViewController 时如何更改 clearsSelectionOnViewWillAppear?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6686203/
clearsSelectionOnViewWillAppear 是表和 Collection View 的 bool 属性,默认设置为 true。根据Apple Reference : A Boole
我有一个管理 UISearchBar 和 UITableView 的 UIViewController。我读过 Apple 不鼓励让多个 UIViewController 管理你的应用程序的一部分,所
我是一名优秀的程序员,十分优秀!