用lable画表格
来源:互联网 发布:思维导图用什么软件 编辑:程序博客网 时间:2024/05/16 05:12
CGRect viewRect=self.view.frame;
//画基本信息
NSDictionary *basicInformDic=(NSDictionary *)[[[dicobjectForKey:@"returnResult"]objectForKey:@"dtBasicInform"]objectAtIndex:0];
NSDictionary *wageInformDic=(NSDictionary *)[[[dicobjectForKey:@"returnResult"]objectForKey:@"dtWageInform"]objectAtIndex:0];
CGRect basicInformRect=CGRectMake(106,20, viewRect.size.width-106,200);
NSArray* basicLabelArray=[NSArrayarrayWithObjects:@"姓名",@"出生日期",@"文化程度",@"取得时间",
@"男",@"籍贯",@"毕业时间",@"政治面貌",
@"民族",@"身份证号",@"学位",@"加入时间",
nil];
[selfdrawGrid:basicInformDic andBakDic:wageInformDic andWidthLabelNumber:3andHeightLabelNumber:4andRect:basicInformRect andLabelArray:basicLabelArray];
//画工资信息
CGRect wageInformRect=CGRectMake(20,200+20, viewRect.size.width-20,300);
NSArray* wageLabelArray=[NSArrayarrayWithObjects:@"单位",@"职务级别",@"岗位工资标准",
@"员工编号",@"职称",@"合同编号",
@"工作岗位",@"取得资格日期",@"合同类型",
@"工作时间",@"公子序列",@"开始日期",
@"工龄起算日",@"岗级",@"结束日期",
@"首次加入中石油日期",@"档次",
nil];
[selfdrawGrid:basicInformDic andBakDic:wageInformDicandWidthLabelNumber:2andHeightLabelNumber:9andRect:wageInformRect andLabelArray:wageLabelArray];
-(void)drawGrid:(NSDictionary *)informDic andBakDic:(NSDictionary *)informDicBak andWidthLabelNumber:(float )widthLabelNumber andHeightLabelNumber:(float )heightLabelNumber andRect:(CGRect )informRect andLabelArray:(NSArray *)labelArray
{
float labelLength=informRect.size.width/widthLabelNumber/2;
float labelHeitht=informRect.size.height/heightLabelNumber;
for (NSUInteger i=0; i<heightLabelNumber; i++)
{
for (NSUInteger j=0; j<widthLabelNumber; j++) {
if (i*widthLabelNumber+j>[labelArray count]-1) {
continue;
}
UILabel *lKey = [[UILabelalloc] initWithFrame:CGRectMake(informRect.origin.x+j*labelLength*2,
informRect.origin.y+i*labelHeitht,
labelLength, labelHeitht)];
lKey.font = [UIFontsystemFontOfSize:14.0f];
lKey.text = [NSStringstringWithFormat:@"%@:",[labelArrayobjectAtIndex:i*widthLabelNumber+j]];
lKey.backgroundColor = [UIColorclearColor];
lKey.textColor = [UIColorblueColor];
lKey.textAlignment =UITextAlignmentRight;
[self.viewaddSubview:lKey];
//value
UILabel *lValue = [[UILabelalloc] initWithFrame:CGRectMake(informRect.origin.x+j*labelLength*2+labelLength,
informRect.origin.y+i*labelHeitht,
labelLength, labelHeitht)];
lValue.font = [UIFontsystemFontOfSize:14.0f];
lValue.text = [informDicobjectForKey: [labelArray objectAtIndex:i*widthLabelNumber+j]];
lValue.backgroundColor = [UIColorclearColor];
lValue.textColor = [UIColorblackColor];
lValue.textAlignment =UITextAlignmentLeft;
[self.viewaddSubview:lValue];
}
}
}
- 用lable画表格
- lable
- lable
- lable
- lable
- 用程序控制输出表格行和列数(用asp.net的中Lable举个例子)
- 用C++画表格
- 用js控制服务器控件Lable的值
- winfrom lable
- 自适应lable
- lable设置
- lable属性
- Lable换行
- lable标签
- 用python的画表格
- 画表格
- 画表格
- 画表格
- C++类的内存对齐
- [c]C语言提高效率和减少代码size的方法
- Hibernate读书笔记-----SQL查询 addScalar()或addEntity()
- 详细解释:nginx中ngx_http_headers_module模块配置及各个参数含义
- hdu_2066
- 用lable画表格
- 金山界面库分析(2)
- asp.net 操作xml文档
- KDE/QT vs GNOME/GTK
- ConcurrentLinkedQueue API 说明
- 百度面试题-编码和相等的数
- 最长回文子串求解
- 分享31个非常有用的 HTML5 教程
- 纯做技术的人啊你没啥骄傲的,你不过是懒罢了