iOS开发之UITableView自定义Header视图和自定义Footer视图
来源:互联网 发布:淘宝贝南海幼儿园应聘 编辑:程序博客网 时间:2024/05/23 01:16
//自定义Header视图
- (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
if (section == 0) {
UIView *view = [[UIViewalloc]init];
UIImageView *imageViews = [[UIImageViewalloc]initWithFrame:CGRectMake(20,30, 20, 25)];
imageViews.image = [UIImageimageNamed:@"help_basic"];
[view addSubview:imageViews];
UILabel *label1=[[UILabelalloc]initWithFrame:CGRectMake(50,30, KYRect.size.width-20,25)];
//label1.layer.borderWidth = 1;
// label1.layer.borderColor = [[UIColor blackColor]CGColor];
label1.textAlignment =NSTextAlignmentLeft;
label1.text=@"基本信息";
label1.font = [UIFontboldSystemFontOfSize:23.0f];
UIView *line = [[UIViewalloc]initWithFrame:CGRectMake(0,69, KYRect.size.width,1)];
line.backgroundColor = [UIColorlightGrayColor];
line.alpha = 0.3f;
[view addSubview:line];
[view addSubview:label1];
return view;
}
if (section == 1) {
UIView *view = [[UIViewalloc]init];
UIImageView *imageViews = [[UIImageViewalloc]initWithFrame:CGRectMake(20,30, 22, 25)];
imageViews.image = [UIImageimageNamed:@"help_question"];
[view addSubview:imageViews];
UILabel *label1=[[UILabelalloc]initWithFrame:CGRectMake(50,30, KYRect.size.width-20,25)];
//label1.layer.borderWidth = 1;
// label1.layer.borderColor = [[UIColor blackColor]CGColor];
label1.textAlignment =NSTextAlignmentLeft;
label1.text=@"使用问题";
label1.font = [UIFontboldSystemFontOfSize:23.0f];
UIView *line = [[UIViewalloc]initWithFrame:CGRectMake(0,69, KYRect.size.width,1)];
line.alpha = 0.3f;
line.backgroundColor = [UIColorlightGrayColor];
[view addSubview:line];
[view addSubview:label1];
return view;
}
return 0;
}
//自定义Footer视图
- (nullable UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
return 0;
}
- iOS开发之UITableView自定义Header视图和自定义Footer视图
- 自定义普通文本TableView header footer 视图
- 自定义普通文本TableView header footer 视图
- 自定义UITableView的Header和Footer
- XListview之自定义Header和footer动画
- IOS之UITableView cell自定义视图中插入Tableview
- iOS开发之自定义ActionSheet视图
- iOS开发之高级视图—— UITableView(四)自定义Cell
- iOS UITableView表视图(3)自定义cell
- webView视图添加header视图和footer视图
- IOS开发自定义UITableView的Header
- IOS开发 - 04.自定义视图
- iOS开发 UI 自定义视图
- 自适应header、footer和全屏视图
- 自定义控件开发之----自定义视图状态
- iOS开发之自定义UITableView
- IOS开发之自定义segment实现视图切换
- IOS开发之自定义segment实现视图切换
- 阿里云推荐码优惠券推荐码获取及使用方法
- 指针函数与函数指针的区别
- 关于JS那些容易被你忽略的那些点(2)
- 【SpringMVC】学习小结
- 求树的高度
- iOS开发之UITableView自定义Header视图和自定义Footer视图
- java.nio.BufferOverflowException
- 【LeetCode】Array Topic总结
- 没有网照样激活软件,用亿图就是这么任性!
- 【java基础】02.Collection类集
- android权限大全
- String和StringBuffer的replace问题
- 任意两点之间的最短路径问题(Floyd算法)--Java语言
- (数据结构)七种常用的排序算法分析及代码实现(上)