from: http://blog.csdn.net/chenyong05314/article/details/9196253
http://blog.csdn.net/daiyelang/article/details/19622189
http://www.tuicool.com/articles/AvUVf2
http://blog.csdn.net/tangaowen/article/details/6452314
最上面tableHeaderView留空间的两种方法UITableView
from : http://blog.sina.com.cn/s/blog_4fcd1ea301014b7e.html
1)
原本打算自己手动设置tabview中的第一行cell,但是需要修改的地方太多了,看到有兄台使用tableHeaderView进行设置,很简单,于是也对其进行了自定义,效果不错。
UITableView 的 cell 默认出现在 uitableview 的第一行,如果你想自定义 UITableViewCell 与导航条间距的话,可以使用下面这行代码
- tableview.tableHeaderView
= [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 20)]autorelease];
Demo
- AFImageViewer*
afView = [[AFImageViewer alloc] initWithFrame:CGRectMake(0,0, 320, 200)]; - afView.backgroundColor=[UIColor
blackColor]; - [afView
setContentMode:UIViewContentModeScaleAs pectFill]; - afView.delegate=self;
- contentTableView.tableHeaderView
= afView;