首页 > 移动平台 > 详细

iOS tableViewCell plane格式下,接近section边缘不显示分割线却被复用解决办法

时间:2015-07-28 18:06:28      阅读:678      评论:0      收藏:0      [点我收藏+]

    今天做公司产品的时候遇到了如题问题,困扰我很长时间,用尽各种办法不能解决,究其原因不知为何,自定义cell低端有view划线的时候,划线一般的显示1像素,而贴着section的显示很少 顶多0.3像素,这个问题很头疼,后来 想到了一个非常好的办法解决:

 

 UIImageView *separatorLine = [[UIImageViewalloc]initWithFrame:CGRectMake(20.0f*SizeScaleX,30*SizeScaleY -1.0f, cell.frame.size.width,1.0f)];

        separatorLine.image = [[UIImageimageNamed:@"所有背景.png"]stretchableImageWithLeftCapWidth:1topCapHeight:0];

        separatorLine.tag =5554;

        

        [cell.contentViewaddSubview:separatorLine];

再做判断

 

 if(indexPath.row == arr.count-1){

        UIImageView *separatorLine = (UIImageView *)[cellviewWithTag:5554];

        separatorLine.hidden =YES;

    }else{

        UIImageView *separatorLine = (UIImageView *)[cellviewWithTag:5554];

 

        separatorLine.hidden =NO;

 

    }

 

iOS tableViewCell plane格式下,接近section边缘不显示分割线却被复用解决办法

原文:http://www.cnblogs.com/liuqixu/p/4683113.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!