Latest 0.0.3
Homepage https://github.com/wzf/UITableView-Placeholder
License MIT
Platforms ios 7.0, requires ARC
Frameworks Foundation, UIKit
Authors

UITableView-Placeholder

UITableView数据为空的时候,给出一个简单的提示,还可以添加一个图标
image

Pod导入

pod 'UITableView+Placeholder'

补充说明

在这一方面,已经有大神级的组件,可跳转至https://github.com/dzenbot/DZNEmptyDataSet

使用(Usage)

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
{
    NSInteger count = 0; //依据业务逻辑,改成对应的值
    [tableView placeholderBaseOnNumber:count iconConfig:^(UIImageView *imageView) {
        // 传入一个想展示的图标
        imageView.image = [UIImage imageNamed:@"emptyTableView"];
    } textConfig:^(UILabel *label) {
        // 设置提示性文字
        label.text      = @"暂时没有数据";
        label.textColor = [UIColor lightGrayColor];
        label.font      = [UIFont systemFontOfSize:15];
    }];
    return count;
}

Latest podspec

{
    "name": "UITableView+Placeholder",
    "version": "0.0.3",
    "summary": "UITableViewu4e3au7a7au65f6uff0cu663eu793au4e00u4e2au63d0u793a",
    "homepage": "https://github.com/wzf/UITableView-Placeholder",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "wangzhanfeng": "[email protected]"
    },
    "source": {
        "git": "https://github.com/wzf/UITableView-Placeholder.git",
        "tag": "0.0.3"
    },
    "frameworks": [
        "Foundation",
        "UIKit"
    ],
    "platforms": {
        "ios": "7.0"
    },
    "source_files": "Classes/**/*.{h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This