Giter Site home page Giter Site logo

peaksimpletable's Introduction

PeakSimpleTable

简单的数据列表,用于显示简单的报表式数据,支持对每一个单元格设置格式

#Information

Conis

Blog: http://iove.net

E-mail: [email protected]

项目主页: https://github.com/conis/PeakSimpleTable

#Screenshot screenshot

#Usage 自用项目,暂时没有时间写使用说明,请参考代码,欢迎Fork或者翻译。 PeakSimpleTable可以用于简单的行列式报表显示,可以自定义每一个单元格的样式。

##init

PeakSimpleTable *simpleTable = [[PeakSimpleTable alloc] initWithFrame: self.bounds];

simpleTable.delegate = self;

[self addSubview: simpleTable];

##property

//委托
@property (nonatomic, strong) id<PeakSimpleTableDelegate> delegate;
//header的高度
@property (nonatomic) CGFloat headerHeight;
//是否显示header
@property (nonatomic) BOOL showHeader;
//标题的背景
@property (nonatomic, strong) UIColor *headerBackgroundColor;
//单元格的背景
@property (nonatomic, strong) UIColor *cellBackgroundColor;
//列之间的距离
@property (nonatomic) CGFloat columnSpacing;
//标题的字段
@property (nonatomic, strong) UIFont *headerFont;
//内容的字体
@property (nonatomic, strong) UIFont *contentFont;
//字段名称
@property (nonatomic, strong) NSArray *fields;

method

//重新加载数据
-(void) reloadData;

##delegate

@optional
//完成列内容,可以再设置label的颜色,字体等
-(void) peakSimpleTable: (PeakSimpleTable *) simpleTable didFinishContent: (UILabel *) contentLabel column: (NSInteger) col row: (NSInteger) row field: (NSString *) field;

//标题完成
-(void) peakSimpleTable: (PeakSimpleTable *) simpleTable didFinishHeader: (UILabel *) headerLabel column: (NSInteger) col field: (NSString *) field;

//获取列宽度
-(CGFloat) peakSimpleTable: (PeakSimpleTable *) simpleTable widthForColumn: (NSInteger) col field: (NSString *) field;

//获取行高
-(CGFloat) peakSimpleTable: (PeakSimpleTable *) simpleTable heightForRow: (NSInteger) row;

//委托必需要提供的内容
@required
//获取列标题
-(NSString *) peakSimpleTable: (PeakSimpleTable *) simpleTable headerForColumn: (NSInteger) col field: (NSString *) field;

//获取列内容
-(NSString *) peakSimpleTable: (PeakSimpleTable *) simpleTable contentForColumn: (NSInteger) col row: (NSInteger) row field: (NSString *) field;

//获取数据的数量
-(NSInteger) peakSimpleTable: (PeakSimpleTable *) simpleTable numberOfRowsInSection: (NSInteger) section;

#LICENSE

MIT

peaksimpletable's People

Contributors

conis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.