/***

iOS8 分割线问题 在xib/storyboard下面解决方案

http://qiita.com/yimajo/items/10f16629200f1beb7852

http://www.cocoachina.com/ios/20141026/10045.html

http://www.2cto.com/kf/201411/349631.html

http://dev.classmethod.jp/smartphone/iphone/ios-8-uitableview-layoutmargins/

http://demo.netfoucs.com/growinggiant/article/details/42002871

*/

- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib. [self.view setLayoutMargins:UIEdgeInsetsZero]; // if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {
//
// [self.tableView setSeparatorInset:UIEdgeInsetsZero];
//
// }
//
// if ([self.tableView respondsToSelector:@selector(setLayoutMargins:)]) {
//
// [self.tableView setLayoutMargins:UIEdgeInsetsMake(0, 0, 0, 0)];
//
// }
// [self.tableView setSeparatorInset:UIEdgeInsetsMake(0,0,0,0)]; }
-(void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews]; if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {
[self.tableView setSeparatorInset:UIEdgeInsetsZero];
} if ([self.tableView respondsToSelector:@selector(setLayoutMargins:)]) {
// [self.tableView setLayoutMargins:UIEdgeInsetsZero];
[self.view setLayoutMargins:UIEdgeInsetsZero];
}
} - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ return ; }
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *ID = @"TableViewCell";
UITableViewCell*cell = [tableView dequeueReusableCellWithIdentifier:ID]; if (cell==nil) {
UINib *nib = [UINib nibWithNibName:@"TableViewCell" bundle:nil];
[tableView registerNib:nib forCellReuseIdentifier:ID];
return [[nib instantiateWithOwner:nil options:nil]lastObject]; }
// cell.preservesSuperviewLayoutMargins = NO;
// if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
// cell.separatorInset = UIEdgeInsetsZero;
// }
//
// if([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]) {
// cell.preservesSuperviewLayoutMargins = false;
// }
//
// if( [cell respondsToSelector:@selector(setLayoutMargins:)]) {
// cell.layoutMargins = UIEdgeInsetsZero;
// [self.view setLayoutMargins:UIEdgeInsetsZero];
// } return cell; }
//然后在UITableView的代理方法中加入以下代码
//- (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];
//
// }
//
//}

iOS 8下使用xib/storybord AutoLayout导致的分割线问题的更多相关文章

  1. iOS回顾笔记(06) -- AutoLayout从入门到精通

    iOS回顾笔记(06) -- AutoLayout从入门到精通 随着iOS设备屏幕尺寸的增多,当下无论是纯代码开发还是Xib/StoryBoard开发,自动布局已经是必备的开发技能了. 我使用自动布局 ...

  2. iOS开发通过代码方式使用AutoLayout (NSLayoutConstraint + Masonry)

    iOS开发通过代码方式使用AutoLayout (NSLayoutConstraint + Masonry) 随着iPhone6/6+设备的上市,如何让手头上的APP适配多种机型多种屏幕尺寸变得尤为迫 ...

  3. 微信团队分享:iOS版微信是如何防止特殊字符导致的炸群、APP崩溃的?

    本文来自微信开发团队yanyang的技术分享. 1.引言 相信大家都遇到过一段特殊文本可以让iOS设备所有app闪退的经历.前段时间大年初一,又出现某个印度语字符引起iOS11系统奔溃,所幸iOS版微 ...

  4. IOS 开发下拉刷新和上拉加载更多

    IOS 开发下拉刷新和上拉加载更多 简介 1.常用的下拉刷新的实现方式 (1)UIRefreshControl (2)EGOTTableViewrefresh (3)AH3DPullRefresh ( ...

  5. nginx负载下站点错误响应会导致其他节点重复响应问题的解决过程

    目录 前言 问题来了 问题又来了 问题分析 困惑 转机 后续 前言: 这是我上周工作过程中的一次解决问题的过程.解决的是nginx负载下站点错误响应导致其他节点重复响应. 我在整理这个记叙文时,在给这 ...

  6. iOS开发UI篇—xib的简单使用

    iOS开发UI篇—xib的简单使用 一.简单介绍 xib和storyboard的比较,一个轻量级一个重量级. 共同点: 都用来描述软件界面 都用Interface Builder工具来编辑 不同点: ...

  7. iOS开发拓展篇—xib中关于拖拽手势的潜在错误

    iOS开发拓展篇—xib中关于拖拽手势的潜在错误 一.错误说明 自定义一个用来封装工具条的类 搭建xib,并添加一个拖拽的手势. 主控制器的代码:加载工具条 封装工具条以及手势拖拽的监听事件 此时运行 ...

  8. Swift技术之如何在iOS 8下使用Swift设计一个自定义的输入法 (主要是NSLayoutConstraint 的使用)

    当前位置: > Swift新手入门 > Swift技术之如何在iOS 8下使用Swift设计一个自定义的输入法 时间:2014-09-10 16:49来源:未知 作者:啊成 举报 点击:5 ...

  9. 李洪强iOS开发之后使用XIB实现横向滚动的UIScrollView

    李洪强iOS开发之后使用XIB实现横向滚动的UIScrollView 11111222

随机推荐

  1. unity3d中检测一个物体是否在摄像机视野范围内

    这个脚本最好是把模型对象的锚点设置在最低点.好了直接上脚本.可以直接复制代码,把CS文件拖到一个Camera上,然后把目标拖到targetTran中去就行了. using UnityEngine; u ...

  2. idea 显示行号

    File->Settings->Editor->General->Appearence->Show Line Number 选中之后"Apply",然 ...

  3. thinkphp修改及编写标签库,编辑器的使用

    在view目录下创建Index_aaa.html <!DOCTYPE html> <html> <head> <meta charset="UTF- ...

  4. Hbase资料汇总

    1.hbase api http://blog.csdn.net/u010967382/article/details/37878701

  5. python 面向对象和类成员和异常处理

    python 面向对象 你把自己想象成一个上帝,你要创造一个星球,首先你要把它揉成一个个球,两个直径就能创造一个球 class star: '''名字(name),赤道直径(equatorial di ...

  6. Support Vector Machine (2) : Sequential Minimal Optimization

    目录 Support Vector Machine (1) : 简单SVM原理 Support Vector Machine (2) : Sequential Minimal Optimization ...

  7. linux获取本机ip

    int get_ip ( in_addr_t addrs[], int asize  ) {         int MAXINTERFACES=16;         int i = 0;     ...

  8. Mysql中用SQL增加、删除字段,修改字段名、字段类型、注释,调整字段顺序总结

    转自:http://www.111cn.net/database/mysql/71648.htm 1.增加一个字段  代码如下 复制代码 //增加一个字段,默认为空 alter table user ...

  9. 磁盘阵列(RAID)实例

    raid技术分类可以分为基于软件raid技术和基于硬件raid技术 raid又分为raid-0.raid-1.raid-5和raid-10 Raid有”廉价磁盘冗余阵列”的意思,就是利用多块廉价的硬盘 ...

  10. jmeter执行顺序