解決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 類型的

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM