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];

        }

     }

  • 相关阅读:
    逼哥
    作业
    malloc的底层实现
    docker基本使用
    对mudo中noncopyable类的理解
    整理
    替换war包中的文件
    SpringMVC(1):SpringMVC入门
    MySQL(5):安装MySQL
    MySQL(4):卸载MySQL
  • 原文地址:https://www.cnblogs.com/KLNL100/p/4828002.html
Copyright © 2011-2022 走看看