# XSGrid **Repository Path**: DaXueShan/XSGrid ## Basic Information - **Project Name**: XSGrid - **Description**: 表格的绘制 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-08-20 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # XSGrid #### 介绍 表格的绘制 #### 软件架构 软件架构说明 #### 安装教程 1. xxxx 2. xxxx 3. xxxx #### 使用说明 XSGrid *grid = [[XSGrid alloc]initWithFrame:CGRectMake(10, 30, 300, 300)]; grid.backgroundColor = [UIColor yellowColor]; [self.view addSubview:grid]; _grid = grid; XSGridColumn *c1 = [XSGridColumn new]; c1.title = @"名字"; c1.keyPath = @"num0"; c1.columnWidth = 100; c1.contentPadding = UIEdgeInsetsMake(0, 10, 0, 10); XSGridColumn *c2 = [XSGridColumn new]; c2.title = @"数学成绩"; c2.keyPath = @"num1"; c2.columnWidth = 100; c2.contentPadding = UIEdgeInsetsMake(0, 10, 0, 10); XSGridColumn *c3 = [XSGridColumn new]; c3.title = @"语文成绩"; c3.keyPath = @"num2"; c3.columnWidth = 100; //列 [grid addColumn:c1]; [grid addColumn:c2]; [grid addColumn:c3]; //每一行 NSMutableDictionary *d1 = [NSMutableDictionary new]; [d1 setObject:@"小明" forKey:c1.keyPath]; [d1 setObject:[NSString stringWithFormat:@"%d", arc4random_uniform(1000) ] forKey:c2.keyPath]; [d1 setObject:[NSString stringWithFormat:@"%d", arc4random_uniform(1000) ] forKey:c3.keyPath]; NSMutableDictionary *d2 = [NSMutableDictionary new]; [d2 setObject:@"小红师捡垃圾费立即票据红监考老师捡垃圾费立即票据" forKey:c1.keyPath]; [d2 setObject:[NSString stringWithFormat:@"%d", arc4random_uniform(1000) ] forKey:c2.keyPath]; [d2 setObject:[NSString stringWithFormat:@"%d", arc4random_uniform(1000) ] forKey:c3.keyPath]; //某个cell 可以直接绘制图片 UIImage*image = [UIImage imageNamed:@"detail_down@3x.png"]; NSMutableDictionary *d3 = [NSMutableDictionary new]; [d3 setObject:@"小明3小明3小明3小明3小明3小明3小明3小明3小明3" forKey:c1.keyPath]; [d3 setObject:image forKey:c2.keyPath]; [d3 setObject:@"88" forKey:c3.keyPath]; [grid addRow:d1]; [grid addRow:d2 rowhHeight:50]; [grid addRow:d3]; [grid refreshGrid]; #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 码云特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)