zoukankan      html  css  js  c++  java
  • 解决UItableView cell的间隔线 separatorStyle ( plain group 两种类型)

    一 . Plain类型的:

    做法

    cell 的backgroupView 是设置的 57 pix,在此基础上 在方法willDisplayCell 中 cell.backgroundView添加一个高为55Pix的view 作为背景

    这样就有了 2pix的 cell 下边框了

     

    -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{

        return 57.0;

    }

     

    -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{

        

        UIView *viewTemp1 = [[UIView alloc]init];

        viewTemp1.backgroundColor=    [UIColorcolorWithPatternImage:[UIImageimageNamed:@"cell_bg_55px_ipad"]];

        viewTemp1.frame=CGRectMake(0, 0, 320, 55);

        cell.backgroundView = [[[UIViewalloc] init]autorelease];

        [cell.backgroundViewaddSubview:viewTemp1];

        

        [viewTemp1 release];

     

             cell.backgroundColor=[UIColorclearColor];

        

    //     cell.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"cell_bg_55px"]];

    }

     

    二 . group 类型的

     

     

  • 相关阅读:
    03Qt信号与槽(2)
    01Qt中的隐式共享
    10GNU C语言函数调用
    09GNU C语言程序编译
    第一本C语言笔记(下)
    07控制器和控制卡(3)
    06控制器和控制卡(2)
    集合
    linux指令(目录类操作指令)
    面向对象三大特征
  • 原文地址:https://www.cnblogs.com/zander/p/2718394.html
Copyright © 2011-2022 走看看