UITableView去除空白cell上多余separator
具体的效果可以参考微信ios7版的UITableview 它最后一行cell的separator是顶到最左边的
首先设置tableFooterView
- _messageTableview.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
然后在willDisplayCell上增加如下代码 控制最后一行separatorInset位置
- - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
- NSMutableDictionary *dic = [typeArray objectAtIndex:indexPath.section];
- NSMutableDictionary *infoDic = [dic objectForKey:@"dic"];
- if (indexPath.row==[infoDic count]-1) {
- NSLog(@"indexPath.row===%d",indexPath.row);
- cell.separatorInset = UIEdgeInsetsMake(10, 0, 0, 0);
- }
- }
参考资料:http://stackoverflow.com/questions/12168002/how-to-remove-last-border-of-last-cell-in-uitableview
http://blog.csdn.net/catandrat111/article/details/7794030
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的更多相关文章
- StringUtils工具类常用方法汇总2(截取、去除空白、包含、查询索引)
在上一篇中总结了StringUtils工具类在判断字符串为空,大小写转换,移除字符或字符序列,替换,反转,切割合并等方面的方法,这次再汇总一下其它常用的方法. 一.截取 StringUtils ...
- iOS-UITableView-处理cell上按钮事件(弹出警示框,页面跳转等)
一. 目的: 实现UITableViewCell上按钮点击事件可以进行页面跳转. 二. 实现方法: 1. 用协议的方式的实现. 2. 需要自定义UITableViewCell. 三. 代码部分. ce ...
- UITableView中复用cell显示信息错乱
UITableView继承自UIScrollview,是苹果为我们封装好的一个基于scroll的控件.上面主要是一个个的 UITableViewCell,可以让UITableViewCell响应一些点 ...
- StringUtils工具类常用方法汇总(截取、去除空白、包含、查询索引)
一.截取 StringUtils中常用的截取字符串的方法如下: substring(String str,int start) substring(String str,int start, in ...
- UITableView左右滑动cell无法显示“删除”按钮的原因分析
http://www.cocoachina.com/bbs/read.php?tid-145693.html - (void)tableView:(UITableView *)tableView co ...
- iOS之UITableView中的cell因为重用机制导致新的cell的数据出现重复或者错乱
UITableView中的cell可以有很多,一般会通过重用cell来达到节省内存的目的:通过为每个cell指定一个重用标识符(reuseIdentifier),即指定了单元格的种类,当cell滚 ...
- objc_setAssociatedObject获取cell上button对应所在的行
#import <UIKit/UIKit.h> @interface TestCell : UITableViewCell @property (weak, nonatomic) IBOu ...
- 按钮在cell上的高亮状态出现的慢
在单元格上放一个全屏长的按钮 高度不是cell的高度 当点击cell上的按钮的时候 按钮的高亮状态会出现的比较慢 因为按钮设置的就是touchUpInside 所以当你向下按的时候 ...
- 7、8上的cell上的一个按钮,当点击按钮时,要拿到这个cell,可以用代理,也可以用superview
/** cell上的付款按钮事件 */ - (IBAction)paymentButtonClick:(UIButton *)sender { /** * @author SongXing, 15-0 ...
随机推荐
- install httpd
tar -zxvf httpd-2.4.4.tar.gzcd httpd-2.4.4./configure --prefix=/apache/home/openfire/httpd24checking ...
- BC之The mook jong
Problem Description ZJiaQ want to become a strong man, so he decided to play the mook jong.ZJiaQ wan ...
- js和jQuery前台校验文件大小
1.支持Google 不支持IE <script type="text/javascript" src="${pageContext.request.context ...
- HDU 4786 Fibonacci Tree
Fibonacci Tree Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) P ...
- Flex对象的Clone & Copy浅析
在flex中有时候会用到ObjectUtil.clone和ObjectUtil.copy方法.下面是官方API的注释. 克隆指定对象,并返回对该克隆的引用.该克隆使用本机序列化技术生成.这意味着在克隆 ...
- Flex AdvancedDatagrid使用
首先我先来看下利用Advanced Datagrid做出的效果,然后我们再对其中所利用的知识进行讲解,效果图如下: 我们来看下这个效果我们所用到的关于Advanced Datagrid的相关知识: 一 ...
- No.003 Longest Substring Without Repeating Characters
Longest Substring Without Repeating Characters Total Accepted: 167158 Total Submissions: 735821 Diff ...
- [前端 1] 使用frameset框架构建网页基本布局
导读:在做项目的过程中,发现网页的一些地方是不变的,比如说顶部.底部.而变幻的内容就只是一部分.这个时候在想,这是每次都刷新一个界面呢,还是有别的快捷方法呢.然后就找到了frameset 这个东西.本 ...
- iOS iOS7 20px 处理
- (void)viewWillAppear:(BOOL)animated { // View defaults to full size. If you want to customize the ...
- PAT1076. Forwards on Weibo(标准bfs模板)
//标准的层次遍历模板 //居然因为一个j写成了i,debug半天.....解题前一定要把结构和逻辑想清楚,不能着急动手,理解清楚题意,把处理流程理清楚再动手,恍恍惚惚的写出来自己慢慢debug吧 # ...