zoukankan      html  css  js  c++  java
  • UITableViewCell的分割线顶头

    第一步:

    -(void)viewDidLayoutSubviews {

        if ([_leftTableView respondsToSelector:@selector(setSeparatorInset:)]) {

            [_leftTableView setSeparatorInset:UIEdgeInsetsZero];

        }

        if ([_leftTableView respondsToSelector:@selector(setLayoutMargins:)])  {

            [_leftTableView setLayoutMargins:UIEdgeInsetsZero];

        }

    }

    第二步:

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

    {

              if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {

                [cell setLayoutMargins:UIEdgeInsetsZero];

            }

            if ([cell respondsToSelector:@selector(setSeparatorInset:)]){

                [cell setSeparatorInset:UIEdgeInsetsZero];

            }

     }

    或者

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

        if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {

            [cell setSeparatorInset:UIEdgeInsetsZero];

        }

        if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {

            [cell setLayoutMargins:UIEdgeInsetsZero];

        }

     }

  • 相关阅读:
    BSGS
    斯特林数 笔记
    「CF932E」Team Work
    「hihoCoder1869」Items
    「Luogu1345」[USACO5.4]奶牛的电信Telecowmunication
    「Luogu4363/BZOJ5248」[九省联考2018]一双木棋chess
    「Luogu2522」[HAOI2011]Problem b
    狄利克雷卷积学习笔记
    莫比乌斯函数学习笔记
    欧拉函数学习笔记
  • 原文地址:https://www.cnblogs.com/KLNL100/p/4828002.html
Copyright © 2011-2022 走看看