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

        }

     }

  • 相关阅读:
    自定义checkbox样式
    自定义select样式
    jsonp
    I/O复用 poll简介
    DOS和DDOS攻击
    TCP状态转换图解析
    Makefile入门
    I/O复用select 使用简介
    替换文本内容
    share memory
  • 原文地址:https://www.cnblogs.com/KLNL100/p/4828002.html
Copyright © 2011-2022 走看看