zoukankan      html  css  js  c++  java
  • 【iOS开发系列】cell切割线置顶

    废话不多说,直接上代码:
    /**
     *  tableViewCell切割线左側置顶 < 1 >
     */
    -(void)viewDidLayoutSubviews
    {
        if ([_tableView respondsToSelector:@selector(setSeparatorInset:)])
        {
            [_tableView setSeparatorInset:UIEdgeInsetsMake(0,0,0,0)];
        }
        
        if ([_tableView respondsToSelector:@selector(setLayoutMargins:)])
        {
            [_tableView setLayoutMargins:UIEdgeInsetsMake(0, 0, 0, 0)];
        }
    }

    /**
     *  tableViewCell切割线左側置顶<2>
     */
    -(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];
        }
    }

    在tableView的xib中仅仅是找到了 setSeparatorInsets 设置了,在cell中的xib中也找到相同设置了。可是没有出效果 。

    难道在xib中也应该找到setLayoutMargins?可是没有找到。哪位大神看到了是否能给个指点。

  • 相关阅读:
    CSS之关于clearfix--清除浮动
    C#之垃圾回收
    C#缓存处理
    Asp.Net Mvc4 Ajax提交数据成功弹框后跳转页面
    Asp.Net MVC Ajax
    C#和SQL操作Xml
    领域模型
    Sql操作表字段
    水晶报表行之间切换颜色
    触发器-Trigger
  • 原文地址:https://www.cnblogs.com/yangykaifa/p/7196426.html
Copyright © 2011-2022 走看看