searchBar 隐藏

CGRect newBounds = self.tableView.bounds;

newBounds.origin.y = newBounds.origin.y + _headerSearchBar.bounds.size.height;

self.tableView.bounds = newBounds;

但是这样隐藏后 当cell个数较少时会出现,push到下一界面再pop回到当前界面searchBar 会重新出现,

动态设置TableFooterView, 使cell的总高度加上TableFooterView的高度大于tableView的高度,就可以避免这一现象.

-(void)tableViewFooterViewHight{

CGRect rect = self.tableView.tableFooterView.frame;

UIView * view = self.tableView.tableFooterView;

self.tableView.tableFooterView = nil;

CGFloat hight = 0;

hight = 62+50;

ABAuthorizationStatus authStatus =

ABAddressBookGetAuthorizationStatus();

if(authStatus != kABAuthorizationStatusAuthorized){

hight +=40;

}else{

hight += 0.0f;

}

hight += 30.f;

hight += ( _data.count + 1 )*65.f;

hight = CGRectGetHeight(self.tableView.frame) - hight;

rect.size.height = hight;

view.frame = rect;

self.tableView.tableFooterView = view;

}

searchBar 隐藏的更多相关文章

  1. 美团HD(5)-选择城市

    DJSelectCityViewController.m #import "DJSelectCityViewController.h" #import "DJConsta ...

  2. iOS:搜索栏控件UISearchBar and SearchDisplayController的使用

    UISearchBar and SearchDisplayController控件: 这是一个带搜索栏和搜索显示控制器的控件,前面的SearchBar是一个搜索栏,它提供一个输入搜索条件的类似于文本框 ...

  3. 美团HD(7)-添加取消搜索按钮

    DJSelectCityViewController.m #pragma mark - UISearchBar 代理方法 /** SearchBar开始编辑 */ - (void)searchBarT ...

  4. 美团HD(6)-添加搜索遮罩

    DJSelectCityViewController.m /** SearchBar开始编辑 */ - (void)searchBarTextDidBeginEditing:(UISearchBar ...

  5. iOS 为键盘添加隐藏按钮

    // 为键盘添加隐藏按钮 UIToolbar * backView = [[UIToolbar alloc]initWithFrame:CGRectMake(, , , )]; [backView s ...

  6. 通过navigationController跳转界面时隐藏navigationBar上的元素

    @import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/c ...

  7. searchBar控件

    那就先了解一下UISearchBar控件吧! UISearchBar控件就是要为你完成搜索功能的一个专用控件.它集成了很多你意想不到的功能和特点! 首先,还是来普及一下UISearchBar控件API ...

  8. UISearchDisplayController隐藏navigationBar需注意

    不能调用self.navigationController.navigationBar.hidden = YES: 调用此代码的话,你隐藏了navigationBar搜索展示控制器就拿不到导航条:就会 ...

  9. IOS Swift UITableViewcontroller实现点击空白处隐藏键盘

    在ios开发中,为了方便,我们经常使用UITableViewcontroller,比如搜索界面为了方便可能更多的使用UITableViewcontroller,那么问题就来了,当我点击搜索框的时候会弹 ...

随机推荐

  1. NDK(9)Application.mk各属性介绍

    本文参考 : http://blog.csdn.net/grimraider/article/details/7587816 在NDK中编写的是本地程序,这个程序的源码在 jni 下,这个本地项目的配 ...

  2. HDU 4644 BWT(Burrows–Wheeler transform+KMP)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4644 题意:给出一个串,按照下面的步骤得到一个新串: (1)首先将其后面增加一个美元符号: (2)将每 ...

  3. 选错实施顾问公司 ERP项目九死一生

    今天接到一个朋友的电话,他是一家企业老总.这位老总感到非常头疼的是他的企业选择了一款国际上名气很大的ERP软件,但实施效果却强差人意.他的疑问是"不是说只要选对了ERP产品,谁实施都能成功吗 ...

  4. C语言输出当前日期和时间

    #include <stdio.h> #include <time.h> char* asctime2(const struct tm *timeptr) { static c ...

  5. [HIHO1323]回文字符串(区间dp)

    题目链接:http://hihocoder.com/problemset/problem/1323 思路:区间dp,按照区间长度枚举所有区间和区间的起始位置.这时也可获取到区间的末位,比对这两个字符是 ...

  6. JAVA设计模式之【简单工厂模式】

    1.创建抽象类User public abstract class User // 抽象类 { public void sameOperation() { System.out.println(&qu ...

  7. 【Todo】深入理解Java虚拟机 读书笔记

    有一个在线系列地址 <深入理解Java虚拟机:JVM高级特性与最佳实践(第2版)> http://book.2cto.com/201306/25426.html 已经下载了这本书(60多M ...

  8. You can't specify target table 'charge' for update in FROM clause

    mysql中不能这么用. (等待mysql升级吧)错误提示就是说,不能先select出同一表中的某些值,再update这个表(在同一语句中) 替 换方 案: create table tmp as s ...

  9. 51nod1199 Money out of Thin Air

    链剖即可.其实就是利用了链剖后子树都在一段连续的区间内所以可以做到O(logn)查询和修改. 线段树细节打错了..要专心!肉眼差错都能找出一堆出来显然是不行的!. #include<cstdio ...

  10. 51nod1122 机器人走方格 V4

    矩阵快速幂求出每个点走n步后到某个点的方案数.然后暴力枚举即可 #include<cstdio> #include<cstring> #include<cctype> ...