如何防止UISearchBar向上移动

时间:2014-05-22 08:51:19

标签: ios uisearchbar

我把UISearchBar放在UIView下,如下图所示。问题是 - 在完成搜索或单击取消后,UISearchBar将转移到顶部,然后我收到错误消息:

2014-05-22 15:45:18.663 MyAPP[14402:60b] *** Assertion failure in -[UITableView layoutSublayersOfLayer:], /SourceCache/UIKit_Sim/UIKit-2935.137/UIView.m:8794
2014-05-22 15:45:18.667 MyAPP[14402:60b] WARNING: GoogleAnalytics 3.06 void GAIUncaughtExceptionHandler(NSException *) (GAIUncaughtExceptionHandler.m:49): Uncaught exception: Auto Layout still required after executing -layoutSubviews. UITableView's implementation of -layoutSubviews needs to call super.
2014-05-22 15:45:23.697 MyAPP[14402:60b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after executing -layoutSubviews. UITableView's implementation of -layoutSubviews needs to call super.'
*** First throw call stack:

问题:

1)是否可以修复UISearchBar的位置?以及如何做到这一点?

2)如何解决错误?

enter image description here enter image description here enter image description here enter image description here

0 个答案:

没有答案