UITableView相关问题

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)

    UIView *headerView = [[UIView alloc] initWithFrame: CGRectMake(0032044)];

    m_tableView.tableHeaderView = headerView;

    2)

    m_tableView.contentInset = UIEdgeInsetsMake(44000);

    m_tableView.scrollIndicatorInsets = UIEdgeInsetsMake(44000);

 

原本打算自己手动设置tabview中的第一行cell,但是需要修改的地方太多了,看到有兄台使用tableHeaderView进行设置,很简单,于是也对其进行了自定义,效果不错。

UITableView 的 cell 默认出现在 uitableview 的第一行,如果你想自定义 UITableViewCell 与导航条间距的话,可以使用下面这行代码

 

[plain]  view plain copy print ?
  1. tableview.tableHeaderView [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 20)]autorelease];  

Demo

 

  1. AFImageViewer* afView [[AFImageViewer alloc] initWithFrame:CGRectMake(0,0, 320, 200)];  
  2. afView.backgroundColor=[UIColor blackColor];  
  3. [afView setContentMode:UIViewContentModeScaleAspectFill];  
  4. afView.delegate=self;  
  5. contentTableView.tableHeaderView afView;  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值