zoukankan      html  css  js  c++  java
  • 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;

        

    }

  • 相关阅读:
    修改linux命令行提示符颜色
    passwd命令
    用户与用户组
    计划任务
    sed简单用法
    sed命令实现对文件内容的添加
    C#颜色选择器的调用操作
    插入排序算法的学习
    二叉树的学习记录
    判断两个单链表是否相交及相交的第一个节点
  • 原文地址:https://www.cnblogs.com/levy/p/4766535.html
Copyright © 2011-2022 走看看