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;

        

    }

  • 相关阅读:
    正则表达式的一些符号
    备份 Repository Backup
    Delphi 文件类型
    superobject.pas 其他人修改的
    TCustomCombo.SetItemIndex(const Value: Integer);
    Error reading symbol file
    任务栏窗口列表
    找回已删除的文件或目录
    总目录
    在Mac下使用crontab执行定时脚本
  • 原文地址:https://www.cnblogs.com/levy/p/4766535.html
Copyright © 2011-2022 走看看