1,设置tableview的separatorInset, layoutMargins

if(myTableView.respondsToSelector("setSeparatorInset:")) {
myTableView.separatorInset = UIEdgeInsetsMake(, , , )
}
if(myTableView.respondsToSelector("setLayoutMargins:")) {
myTableView.layoutMargins = UIEdgeInsetsMake(, , , )
}

2,设置cell的separatorInset, layoutMargins

    func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
if(cell.respondsToSelector("setSeparatorInset:")) {
cell.separatorInset = UIEdgeInsetsMake(, , , )
}
if(cell.respondsToSelector("setLayoutMargins:")) {
cell.layoutMargins = UIEdgeInsetsMake(, , , )
}
}

swift tableview的分割线不能到头的更多相关文章

  1. IOS8 设置TableView Separatorinset 分割线从边框顶端开始

    IOS8 设置TableView Separatorinset 分割线从边框顶端开始   在ios8上 [TableViewsetSeparatorInset:UIEdgeInsetsMake(0,0 ...

  2. swift语言学习之UITableView分割线左边到头的解决

    此方法兼容ios 7.8.9  // 在tableView创建地方设置 if tableView!.respondsToSelector("setSeparatorInset:") ...

  3. 模拟器的tableView的分割线不显示

    只有iOS9和iPhone6 plus模拟器上TableView分割线不会显示. 原因: 由于iPhone6 plus的分辨率较高,开发的时候同常都使用command + 3 或者 command + ...

  4. ios8 ios7 tableview cell 分割线左对齐

    ios8中左对齐代码 //加入如下代码 -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cel ...

  5. 设置tableView的分割线填满cell的方式总结

    方式一:cell的底部添加一个UIView 1.在tableViewController的viewDidLoad中取消系统的分割线 // 取消系统的分割线 self.tableView.separat ...

  6. swift - tableView数据向上收缩动画

    // //  TTTableViewController.swift //  tableVIewAnimation // //  Created by su on 15/12/11. //  Copy ...

  7. IOS tableView 去除分割线 和 不允许选中表格cell

    //去除分割线 self.tableView.backgroundColor=[UIColor colorWithRed:///255.0 alpha:1.0]; self.tableView.sep ...

  8. UI控件自定义tableView的分割线的样式

    - (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetFi ...

  9. iOS TableView的分割线

    if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) { [self.tableView setSeparato ...

随机推荐

  1. 用Asp.net写自己的服务框架

    阅读目录 开始 理解Asp.net管线 HttpHandler HttpModule 关于Content-Encoding的解释 选 HttpHandler 还是 HttpModule ? 看不见的性 ...

  2. Ubuntu-14.04.3下SDL2测试

    最近突然蛋痛想入门Linux,想写个跨平台的游戏,各种坑,备忘,稍微记点笔记. 主要参考这个文章 buntu14.04下C++开发SDL2应用 下载与安装 到http://www.libsdl.org ...

  3. ReStart

    ACM开始了?……重新启用Blog~

  4. Spring绑定表单数据

    Spring提供了一些jsp页面常用的form标签,很大程度上提高了我们开发的速度,不用再一个个的标签去绑定属性,而且后台接收数据也很简单,可以直接接收object对象作为属性.官方form标签介绍的 ...

  5. SQL Server 全文索引创建

    在安装数据库管理系统SQL Server 后,默认情况下全文索引的服务是没有开启的 ,所以首先需要先开启服务,在sql server配置管理器中 (sql server configuration M ...

  6. Android中处理OnClick和OnTouch方法冲突的解决方案

    目前想到的最好的解决方法,大家有更好的欢迎告知. 问题:在一个view中有一个按钮,要求可以通过点按移动这个按钮,同时单纯的点击而不移动这个按钮的话可以跳转到新的Activity. 遇到的困难:按钮的 ...

  7. windows8 APP开发的远程调试

    Win8上面的App开发远程调试: 这里先简单介绍一下对于win8的app的远程调试,环境设置:开发机器装有vs2012的win8系统,目标机器为虚拟机,预装win8系统. 1. 在虚拟机上安装vis ...

  8. 不常用的toLocaleString()方法

    在javascript中所有的对象都具有toLocaleString().toString()和valueOf()方法. 其中,很多情况调用toString()和valueOf方法会返回相同的值,但是 ...

  9. kvm虚拟机--存储池配置梳理(转)

    1.创建基于文件夹的存储池(目录) 2.定义存储池与其目录 1 # virsh pool-define-as vmdisk --type dir --target /data/vmfs 3.创建已定义 ...

  10. TFT-LCD的相关概念

    显示尺寸(display size) 是指实际可视区域的对角线长度,单位是英寸,简称寸(1英寸=2.54厘米). 长宽比(aspect ratio) 是指TFT-LCD可视区域的长度和宽度之比,也叫做 ...