zoukankan      html  css  js  c++  java
  • iOS tableViewCell plane格式下,接近section边缘不显示分割线却被复用解决办法 分类: ios技术 2015-06-12 16:19 136人阅读 评论(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;


        }


    版权声明:本文为博主原创文章,未经博主允许不得转载。

  • 相关阅读:
    day05 集合
    day05 判断敏感字符
    day05 None类型
    day05 字典
    day04元组
    day04列表
    HDFS配额管理(实战)
    hive数据库的哪些函数操作是否走MR
    oracle 裸设备划分 --centos6.5
    redis3.0.7集群部署手册
  • 原文地址:https://www.cnblogs.com/liuqixu/p/4683966.html
Copyright © 2011-2022 走看看