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

  • 相关阅读:
    微信小程序之自定义toast弹窗
    NPOI 设置导出的excel内容样式
    NPOI excel导出快速构建
    GridView 基本使用
    jqgrid 各种方法参数的使用
    经典SQL语句大全
    jqgrid 加载时第一页面只显示多少条数据
    sqlserver2008 调试存储过程
    jqgrid 上移下移单元格
    jgrid 选择器 C#控件
  • 原文地址:https://www.cnblogs.com/javastart/p/8893311.html
Copyright © 2011-2022 走看看