ZMJGanttChart - 用于iOS应用程序的完整可配置电子表格视图用户界面
ZMJGanttChart - 用于iOS应用程序的完整可配置电子表格视图用户界面
ZMJGanttChart
Introduce
Full configurable sheet view user interfaces for iOS applications. With this framework, you can easily create complex layouts like schedule, gantt chart or timetable as if you are using Excel.
Features
Fixed column and row headers Merge cells Circular infinite scrolling automatically Customize gridlines and borders for each cell Customize inter cell spacing vertically and horizontally Fast scrolling, memory efficient UICollectionView like API Well unit tested
Find the above displayed 4 examples in the Examples folder.
Example
To run the example project, clone the repo, and run pod install from the Example directory first.
Requirements
SpreadsheetView is written in Objective-c 2.0 Compatible with iOS 8.0+
Installation
ZMJGanttChart is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ZMJGanttChart'
Getting Started
The minimum requirement is connecting a data source to return the number of columns/rows, and each column width/row height.
#import
Usage
Freeze column and row headers
Freezing a column or row behaves as a fixed column/row header.
Column Header
- (NSInteger)frozenColumns:(SpreadsheetView *)spreadsheetView { return 2;}
Row Header
- (NSInteger)frozenRows:(SpreadsheetView *)spreadsheetView { return 2;}
both
- (NSInteger)frozenColumns:(SpreadsheetView *)spreadsheetView { return 2;}- (NSInteger)frozenRows:(SpreadsheetView *)spreadsheetView { return 2;}
Merge cells
Multiple cells can be merged and then they are treated as one cell. It is used for grouping cells.
- (NSArray
Circular Scrolling
Your table acquires infinite scroll just set circularScrolling property.
Enable horizontal circular scrolling
spreadsheetView.circularScrolling = [Configuration instance].horizontally;
Enable vertical circular scrolling
spreadsheetView.circularScrolling = [Configuration instance].vertically;
Both
spreadsheetView.circularScrolling = [Configuration instance].both
If circular scrolling is enabled, you can set additional parameters that the option not to repeat column/row header and to extend column/row header to the left/top edges. CircularScrolling.Configuration is a builder pattern, can easily select the appropriate combination by chaining properties.
e.g.
spreadsheetView.circularScrolling = [CircularScrollingConfigurationBuilder configurationBuilderWithCircularScrollingState:ZMJCircularScrolling_horizontally_columnHeaderNotRepeated];
spreadsheetView.circularScrolling = [CircularScrollingConfigurationBuilder configurationBuilderWithCircularScrollingState:ZMJCircularScrolling_both_columnHeaderStartsFirstRow;
Customize gridlines, borders and cell spacing
You can customize the appearance of grid lines and borders of the cell. You can specify whether a cell has a grid line or border. Grid lines and borders can be displayed on the left, right, top, or bottom, or around all four sides of the cell.
The difference between gridlines and borders is that the gridlines are drawn at the center of the inter-cell spacing, but the borders are drawn to fit around the cell.
Cell spacing
spreadsheetView.intercellSpacing = CGSizeMake(1, 1);
Gridlines
SpreadsheetView's gridStyle property is applied to the entire table.
spreadsheetView.gridStyle = [GridStyle style:GridStyle_solid width:1 color:[UIColor lightGray]];
You can set different gridStyle for each cell and each side of the cell. If you set cell's gridStyle property to default, SpreadsheetView's gridStyle property will be applied. Specify none means the grid will not be drawn.
cell.gridlines- = [GridStyle style:GridStyle_solid width:1 color:[UIColor blue]];cell.gridlines.left = [GridStyle style:GridStyle_solid width:1 color:[UIColor blue]];cell.gridlines.bottom= [GridStyle borderStyleNone];cell.gridlines.right = [GridStyle borderStyleNone];
Border
You can set different borderStyle for each cell as well.
cell.borders- = [GridStyle style:GridStyle_solid width:1 color:[UIColor red]];cell.borders.left = [GridStyle style:GridStyle_solid width:1 color:[UIColor red]];cell.borders.bottom= [GridStyle style:GridStyle_solid width:1 color:[UIColor red]];cell.borders.right = [GridStyle style:GridStyle_solid width:1 color:[UIColor red]];
Author
keshiim, keshiim@163.com
License
ZMJGanttChart is available under the MIT license. See the LICENSE file for more info.
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~