searchBar 隐藏
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 隐藏的更多相关文章
- 美团HD(5)-选择城市
DJSelectCityViewController.m #import "DJSelectCityViewController.h" #import "DJConsta ...
- iOS:搜索栏控件UISearchBar and SearchDisplayController的使用
UISearchBar and SearchDisplayController控件: 这是一个带搜索栏和搜索显示控制器的控件,前面的SearchBar是一个搜索栏,它提供一个输入搜索条件的类似于文本框 ...
- 美团HD(7)-添加取消搜索按钮
DJSelectCityViewController.m #pragma mark - UISearchBar 代理方法 /** SearchBar开始编辑 */ - (void)searchBarT ...
- 美团HD(6)-添加搜索遮罩
DJSelectCityViewController.m /** SearchBar开始编辑 */ - (void)searchBarTextDidBeginEditing:(UISearchBar ...
- iOS 为键盘添加隐藏按钮
// 为键盘添加隐藏按钮 UIToolbar * backView = [[UIToolbar alloc]initWithFrame:CGRectMake(, , , )]; [backView s ...
- 通过navigationController跳转界面时隐藏navigationBar上的元素
@import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/c ...
- searchBar控件
那就先了解一下UISearchBar控件吧! UISearchBar控件就是要为你完成搜索功能的一个专用控件.它集成了很多你意想不到的功能和特点! 首先,还是来普及一下UISearchBar控件API ...
- UISearchDisplayController隐藏navigationBar需注意
不能调用self.navigationController.navigationBar.hidden = YES: 调用此代码的话,你隐藏了navigationBar搜索展示控制器就拿不到导航条:就会 ...
- IOS Swift UITableViewcontroller实现点击空白处隐藏键盘
在ios开发中,为了方便,我们经常使用UITableViewcontroller,比如搜索界面为了方便可能更多的使用UITableViewcontroller,那么问题就来了,当我点击搜索框的时候会弹 ...
随机推荐
- MapReduce读取hdfs上文件,建立词频的倒排索引到Hbase
Hdfs上的数据文件为T0,T1,T2(无后缀): T0: What has come into being in him was life, and the life was the light o ...
- UVa 10154 - Weights and Measures
UVa 10154 - Weights and Measures I know, up on top you are seeing great sights, But down at the bot ...
- 加密解密(6)RSA算法过程图解
转自: http://blog.csdn.net/21aspnet/article/details/7249401 RSA算法 RSA公钥加密算法是1977年由Ron Rivest.Adi Shami ...
- UESTC 1074 秋实大哥搞算数 栈模拟
秋实大哥搞算数 Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Submit S ...
- Charles是mac的iddler抓包工具
windows下面我们经常使用 Fiddler 抓包工具进行代理等一系列操作.然而,在 Mac 下 http://en.softonic.com/s/java-se-6:mac
- JavaScript 类的定义和引用 JavaScript高级培训 自定义对象
在Java语言中,我们可以定义自己的类,并根据这些类创建对象来使用,在Javascript中,我们也可以定义自己的类,例如定义User类.Hashtable类等等. 一,概述 在Java语言中 ...
- OpenStack(0) - Table of Contents
1. Keystone OpenStack Identity Service2. Starting OpenStack Image Service3. Starting OpenStack Compu ...
- xxx_cast类型转换
xxx_cast是一个统称,它指的是static_cast(静态转换),const_cast(常量转换),reinterpert_cast(重解释转换),dynamic_cast(动态转换).本次我们 ...
- C语言之字节对齐
在C语言编程中,有时为了达到减少运行的时间的目的,需要浪费一些空间:而有时为了节省空间,使它的运行时间增长.而字节对齐则是为了访问效率,用空间换取时间. 要掌握字节对齐,首先得明确一下四个概念: 1. ...
- 菜鸟学习笔记4——jquery事件
方法 描述 bind() 向匹配元素附加一个或更多事件处理器 blur() 触发.或将函数绑定到指定元素的 blur 事件 change() 触发.或将函数绑定到指定元素的 change 事件 cli ...