ios:改变tableview的titleForHeaderInSection字体颜色设置
来源:互联网 发布:linux安装eclipse 编辑:程序博客网 时间:2024/06/05 04:59
方法如下:
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UIView* customView = [[[UIViewalloc] initWithFrame:CGRectMake(10.0, 0.0, 300.0, 44.0)]autorelease];
UILabel * headerLabel = [[[UILabelalloc] initWithFrame:CGRectZero]autorelease];
headerLabel.backgroundColor = [UIColorclearColor];
headerLabel.opaque = NO;
headerLabel.textColor = [UIColorlightGrayColor];
headerLabel.highlightedTextColor = [UIColorwhiteColor];
headerLabel.font = [UIFontboldSystemFontOfSize:18];
headerLabel.frame = CGRectMake(10.0, 0.0, 300.0, 44.0);
if (section == 0) {
headerLabel.text = @"测试1";
}else if (section == 1){
headerLabel.text = @"测试2";
}else if (section == 2){
headerLabel.text = @"测试3";
}else if (section == 3){
headerLabel.text = @"测试4";
}
[customView addSubview:headerLabel];
return customView;
}
//别忘了设置高度
- (CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 44.0;
}
- ios:改变tableview的titleForHeaderInSection字体颜色设置
- iOS开发用Tableview实现能改变字体颜色的高仿系统的ActionSheet
- iOS改变状态栏的字体颜色
- iOS 改变状态栏的字体颜色
- tableview模版自定义willDisplayCell改变字体颜色
- 如何设置tableview中head的字体颜色?
- iOS滑动tableView来改变导航栏的颜色
- iOS tableView 改变头视图和脚视图的颜色
- iOS滑动tableView来改变导航栏的颜色
- iOS滑动tableView来改变导航栏的颜色
- iOS改变状态栏字体颜色
- 设置tableView的颜色
- 设置titleForHeaderInSection
- iOS label设置不同的字体 颜色
- IOS 设置UIButton上字体的颜色
- ios 改变状态栏颜色以及字体颜色
- iOS如何改变所有界面的状态栏的字体颜色
- iOS中设置tableview的选中时的文字颜色
- android学习之widget3
- 在WinForm上添加语音朗读功能
- 调用另一个Activity之1
- android dialog ——ProgressDialog 进度条对话框详解
- Linux shll中的$符号 -- 读取命令行参数
- ios:改变tableview的titleForHeaderInSection字体颜色设置
- Eclipse快捷键大全(转载)
- poj3130 && poj3335 半平面交
- 侯捷 more effective c++(WQ中文版) 阅读笔记1
- enable URL Rewrite for magento
- 嵌入式核心书籍
- 给eclipse添加html jsp js智能提示
- linux 常用到的10个命令
- 图解教你如何使用ANT打包java程序