All Projects → zhnnnnn → ZHNformView

zhnnnnn / ZHNformView

Licence: other
🖱 表格控件,异步绘制

Programming Languages

objective c
16641 projects - #2 most used programming language

ZHNformView

项目需要用到表格来展示数据,最开始我想到的是封装一些tableview来显示。但是我尝试了之后发现实在是性能堪忧。没办法,找了一圈也找到符合我要求的库。干脆自己写一个算了

image

主要特性
  • 异步绘制,性能保障。

  • 自定义各类颜色字体大小之类属性。

  • 接口设计类似UitableView一看就懂。

使用方法

1.把ZHNformView文件拖入到项目中

2.创建view设置属性实现代理方法类似如下(具体看如何使用viewcontroller里代码)

#pragma mark - zhnformView delegate
- (NSArray<NSString *> *)headTitleArrayForZHNformView:(ZHNformView *)formView{
    return self.array;
}

- (NSInteger)numbOfSectionsInZHNformView:(ZHNformView *)forView{
    return 3;
}

- (NSString *)ZHNformView:(ZHNformView *)formView ContentOfCol:(NSInteger)col inRow:(NSInteger)row{
    return @"zhnnnnn出品";
}

- (NSArray *)itemHeightPercentArrayForZHNformView:(ZHNformView *)formView{
    return @[@"0.1",@"0.5",@"0.3",@"0.1"];
}

- (UIColor *)ZHNformView:(ZHNformView *)formView stringColorOfCol:(NSInteger)col inRow:(NSInteger)row{
    if (row == 1) {
        if (col == 1) {
            return [UIColor yellowColor];
        }
       return [UIColor redColor];
    }
    return nil;
}
- (UIColor *)ZHNformView:(ZHNformView *)formView headStringColorOfCol:(NSInteger)Col{
    if (Col == 1) {
        return [UIColor yellowColor];
    }
    return [UIColor blueColor];
}

- (CGFloat)headTitleHeightForZHNformView:(ZHNformView *)formView{
    return 100;
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].