zoukankan      html  css  js  c++  java
  • 解决表视图分割线的延长问题 -----最简单的方法

    写上两个方法即可:

     1 //将要显示Cell的时候执行该代理方法
     2 - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
     3 {
     4     //补齐分割线、两边延长
     5     [self replenishLine:cell];
     6 }
     7 
     8 //补齐分割线、两边延长
     9 -(void)replenishLine:(UIView *)view{
    10     
    11     if ([view respondsToSelector:@selector(setSeparatorInset:)])
    12     {
    13         [(UITableViewCell *)view setSeparatorInset:UIEdgeInsetsZero];//注意这里:必须将view强制转换成(UITableViewCell *)类,不然会报错。
    14     }
    15     if ([view respondsToSelector:@selector(setLayoutMargins:)])
    16     {
    17         [view setLayoutMargins:UIEdgeInsetsZero];
    18     }
    19 }
  • 相关阅读:
    处理数据
    Vue--Vue常用指令及操作
    Vue--Vue实例
    ES6--解构赋值
    ES6--入门
    前端模块化开发
    Node.js--入门
    HTML5--canvas与svg的使用
    input整理
    移动端开发入门
  • 原文地址:https://www.cnblogs.com/pengsi/p/5359364.html
Copyright © 2011-2022 走看看