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?可是没有找到。哪位大神看到了是否能给个指点。

  • 相关阅读:
    CentOS6.5配置网络
    php curl 总结
    laravel-5-doctrine-2 教程
    DOS 总结
    Centos如何通过yum安装php7
    sql with 写法
    php 汉字转拼音函数
    MYSQL 升序排序但值为0的排最后
    zookeeper基础知识
    初识redis
  • 原文地址:https://www.cnblogs.com/yangykaifa/p/7196426.html
Copyright © 2011-2022 走看看