问题详情:html
首先是TableView 做为 NavigationController 的 RootViewContrller, 而后UISearchBarios
添加到TableView 的 headView 上,同时 UISearchDisplayController 的 contentsControllerapp
为tableView, SearchBar 为tableView headview 上的 searhBar,而后点击后 searchBar 会平滑post
移动到 NavgationBar 的位置,点击取消或蒙版的,searhBar 会跳动下再回到正确的位置。ui
解决办法:code
在控制器的viewdidload: 中加入htm
[self setAutomaticallyAdjustsScrollViewInsets:YES]; [self setExtendedLayoutIncludesOpaqueBars:YES];
查找缘由过程:blog
首先是看到 FontAwesome 的搜索没有问题而后就看其实现,没有改变UINavigationBar的默认颜色,图片
没有UINavigationItem,而后就将其所有注释,而后问题依然, 再 设置UINavigationBar 的 translucent 属性get
为YES,接着打开 UINavigationBar 的背景色,而后问题又出现了,因为背景色要同时设置状态栏的颜色,因此设置代码为
[[UINavigationBar appearance]setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];
同时不使用 图片的方式,经过遍历系统子控件设UINavigationBar 的设置背景色一样也会致使跳动,
问题就多是系统SDK的问题了,猜想而已。。而后就各类关键词搜。。最后。。。
详情解释:
http://stackoverflow.com/questions/20565980/uisearchbar-in-uitableviewheader-strange-animation-on-ios-7