具体的效果可以参考微信ios7版的UITableview 它最后一行cell的separator是顶到最左边的

首先设置tableFooterView

  1. _messageTableview.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];

然后在willDisplayCell上增加如下代码 控制最后一行separatorInset位置

  1. - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
  2. NSMutableDictionary *dic = [typeArray objectAtIndex:indexPath.section];
  3. NSMutableDictionary *infoDic = [dic objectForKey:@"dic"];
  4. if (indexPath.row==[infoDic count]-1) {
  5. NSLog(@"indexPath.row===%d",indexPath.row);
  6. cell.separatorInset = UIEdgeInsetsMake(10, 0, 0, 0);
  7. }
  8. }

参考资料:http://stackoverflow.com/questions/12168002/how-to-remove-last-border-of-last-cell-in-uitableview

http://blog.csdn.net/catandrat111/article/details/7794030

http://stackoverflow.com/questions/1369831/eliminate-extra-separators-below-uitableview-in-iphone-sdk/1789714#1789714

http://blog.cnrainbird.com/index.php/2013/10/05/yin_cang_uitableview_xia_bu_xu_yao_de_fen_ge_xian_zhuan/

转载自:http://blog.csdn.net/mideveloper/article/details/20365009

UITableView去除空白cell上多余separator的更多相关文章

  1. StringUtils工具类常用方法汇总2(截取、去除空白、包含、查询索引)

      在上一篇中总结了StringUtils工具类在判断字符串为空,大小写转换,移除字符或字符序列,替换,反转,切割合并等方面的方法,这次再汇总一下其它常用的方法. 一.截取   StringUtils ...

  2. iOS-UITableView-处理cell上按钮事件(弹出警示框,页面跳转等)

    一. 目的: 实现UITableViewCell上按钮点击事件可以进行页面跳转. 二. 实现方法: 1. 用协议的方式的实现. 2. 需要自定义UITableViewCell. 三. 代码部分. ce ...

  3. UITableView中复用cell显示信息错乱

    UITableView继承自UIScrollview,是苹果为我们封装好的一个基于scroll的控件.上面主要是一个个的 UITableViewCell,可以让UITableViewCell响应一些点 ...

  4. StringUtils工具类常用方法汇总(截取、去除空白、包含、查询索引)

    一.截取   StringUtils中常用的截取字符串的方法如下: substring(String str,int start) substring(String str,int start, in ...

  5. UITableView左右滑动cell无法显示“删除”按钮的原因分析

    http://www.cocoachina.com/bbs/read.php?tid-145693.html - (void)tableView:(UITableView *)tableView co ...

  6. iOS之UITableView中的cell因为重用机制导致新的cell的数据出现重复或者错乱

      UITableView中的cell可以有很多,一般会通过重用cell来达到节省内存的目的:通过为每个cell指定一个重用标识符(reuseIdentifier),即指定了单元格的种类,当cell滚 ...

  7. objc_setAssociatedObject获取cell上button对应所在的行

    #import <UIKit/UIKit.h> @interface TestCell : UITableViewCell @property (weak, nonatomic) IBOu ...

  8. 按钮在cell上的高亮状态出现的慢

    在单元格上放一个全屏长的按钮  高度不是cell的高度    当点击cell上的按钮的时候   按钮的高亮状态会出现的比较慢   因为按钮设置的就是touchUpInside   所以当你向下按的时候 ...

  9. 7、8上的cell上的一个按钮,当点击按钮时,要拿到这个cell,可以用代理,也可以用superview

    /** cell上的付款按钮事件 */ - (IBAction)paymentButtonClick:(UIButton *)sender { /** * @author SongXing, 15-0 ...

随机推荐

  1. [SQL]声明触发器 <待整理>

    ./*声明触发器 create trigger dl_stu_mess4 on student for delete as declare @name_id int select @name_id=s ...

  2. Net文章汇总帖

    DevExpress:Data Grid ExamplesHow to: Initialize Cells in Newly Created RowsHow to: Set a Cell Value ...

  3. (转)ASP.NET MVC4 部署错误 Could not load file or assembly

    使用VS2010 测试ASP.NET MVC 4 Web API 在部署时候遇到了问题,发现园友有解决的方式,因此转载.         我的解决方式有两种:使用VS2015将VS2010的项目重新发 ...

  4. Troubleshooting 'library cache: mutex X' Waits.

    What is a 'library cache: mutex X' wait? The mutex feature is a mechanism to control access to in me ...

  5. QT5.3.2在ARM上的移植

    ubuntu10.04 准备移植phonon,4.5移植失败.播放声音就出错...没办法.转移到QtMutimedia 安装交叉编译工具这里就不提了... 1.下载QT5.3.2:http://dow ...

  6. No.011 Container With Most Water

    11. Container With Most Water Total Accepted: 86363 Total Submissions: 244589 Difficulty: Medium Giv ...

  7. C语言 不看怎么存,只看怎么读 ,短字节长字节之间的转换

    不看怎么存,只看怎么读 e.g. int a = 010; //8以8进制存 int b = 8;//8以10进制存 printf("%d %d\n",a,b); 以十进制取 a和 ...

  8. tomcat 页面管理

    <role rolename="admin-gui"/> <role rolename="manager-gui"/> <user ...

  9. [Hibernate 1]Hibernate的环境搭建

    一.Hibernate是什么 直接使用JDBC操作数据库的步骤很繁琐,JDBC操作的是关系型数据库,而我们用JAVA开发程序,则使用面向对象的思想.Hibernate正是在这两种不同的模型之间建立关联 ...

  10. 用C++实现网络编程---抓取网络数据包的实现方法

    一般都熟悉sniffer这个工具,它可以捕捉流经本地网卡的所有数据包.抓取网络数据包进行分析有很多用处,如分析网络是否有网络病毒等异常数据,通信协议的分析(数据链路层协议.IP.UDP.TCP.甚至各 ...