码迷,mamicode.com
首页 > 其他好文 > 详细

tableView的创建

时间:2015-04-02 20:46:23      阅读:97      评论:0      收藏:0      [点我收藏+]

标签:

总结一下tableView的知识点
1.tableView的创建
//tableView的创建 //1.初始化 UITableView *tableView = [[UITableView alloc] initWithFrame:self.view.frame style:UITableViewStylePlain]; //2.设置属性(行高, 分割线, 表头, 表尾) tableView.rowHeight = 60; //UITableViewCellSeparatorStyleSingleLine(默认) tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; tableView.separatorColor = [UIColor redColor]; tableView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0); tableView.backgroundColor = [UIColor grayColor]; UILabel *headerLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 375, 30)]; headerLabel.text = @"IOS应用排行榜"; headerLabel.textAlignment = NSTextAlignmentCenter; tableView.tableHeaderView = headerLabel;//表头,需要先创建一个Label,然后把创建好的Label赋给表头表尾 [headerLabel release]; //通过表尾可以清除多余分割线 //tableView.tableFooterView = [[[UIView alloc] init] autorelease]; //设置是否允许多选 tableView.allowsMultipleSelection = YES; //3. 添加父视图 [self.view addSubview:tableView]; //4. 释放 [tableView release];

 

 

tableView的创建

标签:

原文地址:http://www.cnblogs.com/zhaoweizheng/p/4388221.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!