zoukankan      html  css  js  c++  java
  • iOS8 tableview separatorInset cell分割线左对齐,ios7的方法失效了


    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    -(void)viewDidLayoutSubviews {
        
        if ([self.mytableview respondsToSelector:@selector(setSeparatorInset:)]) {
            [self.mytableview setSeparatorInset:UIEdgeInsetsZero];
     
        }
        if ([self.mytableview respondsToSelector:@selector(setLayoutMargins:)])  {
            [self.mytableview setLayoutMargins:UIEdgeInsetsZero];
        }
     
    }
     
    -(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];
        }
    }

    方法2:

    使用UIAppearance,在程序开始的时候设置全局默认外观,不错的方法

  • 相关阅读:
    有用的sql语句积累
    spring boot sso 学习资源
    notepad++ 常用快捷键
    artTemplate的使用总结
    ajax完整请求
    03 Mybatis框架---学习笔记1--框架的概念及优势
    02 Struts2框架----学习笔记2(了解一下,已过时)
    IDEA 获取类的相对路径和绝对路径
    01 Struts2框架学习(了解一下,已过时)
    喜马拉雅 FM 已购付费音频下载
  • 原文地址:https://www.cnblogs.com/jgCho/p/5557101.html
Copyright © 2011-2022 走看看