zoukankan      html  css  js  c++  java
  • 第19月第20天 UITableView:改变 TableHeaderView 的高度 获取目录大小

    1.UITableView:改变 TableHeaderView 的高度

    CGRect newFrame = headerView.frame;
    newFrame.size.height = newFrame.size.height + webView.frame.size.height;
    headerView.frame = newFrame;
    [self.tableView setTableHeaderView:headerView];

    http://www.cnblogs.com/ihojin/p/tableHeaderView-resizeheight.html

    2.

    static long long fileSizeAtPath(NSString *filePath) {
        struct stat st;
        
        //获取文件的一些信息,返回0的话代表执行成功
        if(lstat([filePath cStringUsingEncoding:NSUTF8StringEncoding], &st) == 0){
            
            //返回这个路径下文件的总大小
            return st.st_size;
        }
        return 0;
    }
    
    
    static long long folderSizeAtDirectory(NSString *folderPath) {
        NSFileManager* manager = [NSFileManager defaultManager];
        if (![manager fileExistsAtPath:folderPath]) {
            return 0;
        }
        NSEnumerator *childFilesEnumerator = [[manager subpathsAtPath:folderPath] objectEnumerator];
        NSString* fileName;
        long long folderSize = 0;
        while ((fileName = [childFilesEnumerator nextObject]) != nil) {
            NSString* fileAbsolutePath = [folderPath stringByAppendingPathComponent:fileName];
            folderSize += fileSizeAtPath(fileAbsolutePath);
        }
        return folderSize;
    }

     https://github.com/HCat/trafficPolice

  • 相关阅读:
    window 7/8/10 安装nginx
    全面了解 Nginx 到底能做什么
    MySQL优化
    office 2013 破解工具 及 软件下载
    centos6+如何对外开放80,3306端口号或者其他端口号
    CentOS 中查看软件的版本号
    CentOS 中安装 mysql 5.7+
    STL入门大全(待编辑)
    Feign
    微信公众号
  • 原文地址:https://www.cnblogs.com/javastart/p/8893311.html
Copyright © 2011-2022 走看看