自定义UITableView的Section的title的样式
2013-12-18 07:24
393 查看
这是设置rFooter的Section
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return 21.0f;
}
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
NSString *sectionTitle = [selftableView:tableView
titleForFooterInSection:section];
if (sectionTitle == nil) {
return nil;
}
UILabel *label = [[UILabelalloc]
init];
label.frame = CGRectMake(20,8,
320, 21);
label.lineBreakMode=NSLineBreakByWordWrapping;
label.numberOfLines=0;
label.backgroundColor = [UIColorclearColor];
label.textColor = [UIColorlightGrayColor];
label.font = [UIFontboldSystemFontOfSize:13];
label.text = sectionTitle;
UIView *view = [[UIViewalloc]
init];
[view addSubview:label];
return view;
}
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section
{
switch (section) {
case 0:
return @"";
break;
case 1:
return@"XXXXXXXXXXXXX";
break;
case 2:
return @"";
break;
default:
return @"";
break;
}
}
设置rFooterInSection
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return 21.0f;
}
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
NSString *sectionTitle = [selftableView:tableView
titleForFooterInSection:section];
if (sectionTitle == nil) {
return nil;
}
UILabel *label = [[UILabelalloc]
init];
label.frame = CGRectMake(20,8,
320, 21);
label.lineBreakMode=NSLineBreakByWordWrapping;
label.numberOfLines=0;
label.backgroundColor = [UIColorclearColor];
label.textColor = [UIColorlightGrayColor];
label.font = [UIFontboldSystemFontOfSize:13];
label.text = sectionTitle;
UIView *view = [[UIViewalloc]
init];
[view addSubview:label];
return view;
}
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section
{
switch (section) {
case 0:
return @"";
break;
case 1:
return@"XXXXXXXXXXXXX";
break;
case 2:
return @"";
break;
default:
return @"";
break;
}
}
设置rFooterInSection
相关文章推荐
- 自定义UITableView的Section的title的样式
- [iOS UItableView 自定义Section] 自定义Section 修改title样式
- 自定义UITableView的Section 的 title 的字体 和颜色
- 修改UITableView section header title的样式
- UITableView样式的自定义
- UITableView自定义Section
- UITableView 样式的自定义
- 【UIKit】UITableView 10 自定义cell样式
- 自定义Section:修改UITableView的Section的背景和字体
- UITableView 应用(五)UITableView样式的自定义
- 修改UITableView titleForHeader 的风格样式
- 自定义Section:修改UITableView的Section的背景和字体
- UITableView-的cell 自定义(高度and样式)
- IOS_设置UITableView Section的背景颜色和字体颜色(自定义section布局)
- 自定义UITableView的左滑动样式
- UITableView样式的自定义
- UITableView-的cell 自定义 高度,样式
- iphone uitableview 设置分区标题(section title)
- 去掉UITableViewStylePlain样式下Section停留问题
- 表格的Section HeaderTitle 标题样式自定义