zoukankan      html  css  js  c++  java
  • 解决tableViewCell分割线不到左边界的问题

    在tableView控制器的.m文件中任何位置加入以下两个方法即可解决
    
    /**
     *  下面两个方法解决cell分割线不到左边界的问题
     */
    -(void)viewDidLayoutSubviews {
        
        if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {
            [self.tableView setSeparatorInset:UIEdgeInsetsZero];
            
        }
        if ([self.tableView respondsToSelector:@selector(setLayoutMargins:)])  {
            [self.tableView setLayoutMargins:UIEdgeInsetsZero];
        }
        
    }
    
    /**
     * 这个方法和上面一个方法解决cell分割线不到左边界的问题
     */
    -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPat{
        if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
            [cell setLayoutMargins:UIEdgeInsetsZero];
        }
        if ([cell respondsToSelector:@selector(setSeparatorInset:)]){
            [cell setSeparatorInset:UIEdgeInsetsZero];
        }
    }
    
  • 相关阅读:
    配置并学习微信JS-SDK(1)
    在 Sublime Text 3 中运行 PHP
    apache-配置虚拟主机
    mysql-积累管理sql语句
    博客园-推荐发博客工具的安装配置
    注释多行文本
    nargin
    Sublime Text
    The MATLAB Profiler
    Fig723.asy
  • 原文地址:https://www.cnblogs.com/ithongjie/p/4882390.html
Copyright © 2011-2022 走看看