TableView分割线从顶端开始
如果什么都不设置的话 分割线是从cell.textlabel处开始的
如果加上
[_myTableView setSeparatorInset:UIEdgeInsetsMake(0, 0, 0, 0)];
分割线是从cell.imageView.image处开始的
如果想从顶端开始加入下列代码就OK了。。。具体原因本菜鸟也不清楚
-(void)viewDidLayoutSubviews
{
if ([self.myTableView respondsToSelector:@selector(setSeparatorInset:)]) {
[self.myTableView setSeparatorInset:UIEdgeInsetsMake(0,0,0,0)];
}
if ([self.myTableView respondsToSelector:@selector(setLayoutMargins:)]) {
[self.myTableView setLayoutMargins:UIEdgeInsetsMake(0,0,0,0)];
}
}
-(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];
}
}
TableView分割线从顶端开始的更多相关文章
- 解决tableView分割线左边不到边的情况
//解决tableView分割线左边不到边的情况// if ([tableView respondsToSelector:@selector(setSeparatorInset:)]) {// ...
- tableView 分割线的处理
有时候根据UI设计图的需要我们需要对原生的TableView分割线做靠左,靠右的操作 在下面这个方法中实现即可. - (void)tableView:(UITableView *)tableView ...
- oc TableView 分割线(separator)部分显示问题
问题:当TableView的cell不能显示完整个屏幕(屏幕有剩余),则没有显示cell的地方也会显示分割线,这不是我们想要的,正常情况下,如果没有cell则应没有分割线.如下图所示:左图为遇到问题, ...
- tableview分割线
默认分割线,左边不到屏幕: TableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; 三种结构体样式: /** UITab ...
- iOS tableView分割线高度自定义
1.系统自带的集中分割线的形式 myTableView.separatorStyle=UITableViewCellSeparatorStyleNone;(这个是去掉所有分割线)可以通过这个来设置 2 ...
- swift 一句代码补全tableView分割线
1.swift实现分割线补全 swift一个大进步,只要设置tableView.separatorInset = UIEdgeInsets.zero即可补全分割线, 2.OC实现分割线补全 而在OC中 ...
- tableview 分割线置最左边的解决方法
首先在viewDidLoad方法加入以下代码: if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) { [se ...
- iOS-修改TableView分割线样式
实现代码: myTableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; 有三种样式: UITableViewCellS ...
- 模拟器的tableView的分割线不显示
只有iOS9和iPhone6 plus模拟器上TableView分割线不会显示. 原因: 由于iPhone6 plus的分辨率较高,开发的时候同常都使用command + 3 或者 command + ...
随机推荐
- gucci fake bags is usually really a sign of luxurious
As soon as the violent trembling from the planet, standing company, people will certainly need to st ...
- 例子:Background Audio Streamer Sample
The Background Audio Streamer sample demonstrates how to create an app that uses a MediaStreamSource ...
- 在linux中查询硬件相关信息
1.查询cpu的相关 a.查询CPU的统计信息 使用命令:lscpu 得到的结果如下: Architecture: x86_64 CPU op-mode(s): -bit, -bit Byte Ord ...
- js控制select下拉列表数据绑定
JS代码部分: <script type="text/javascript"> $(document).ready(function () { $("sel ...
- multipath tcp experiment
git clone https://github.com/Neohapsis/mptcp-abuse.git sudo apt-get install python-pip sudo pip inst ...
- Pair Project: Elevator Scheduler [电梯调度算法的实现和测试] --11061188刘强
结对编程总结 队员:刘强(11061188) 林谋武(11061169) 结对编程: 结对编程的优点: 1. 两个人合作,相比于一个人自己奋斗而言,更能激发自己的潜能:我们在合作过程中,互相学习,互 ...
- php 目录函数和日期函数
continue . break . exit目录函数opendir(); 打开一个文件夹is_file 只判断文件是否存在: file_exists 判断文件是否存在或者是目录是否存在: is_di ...
- C++中的private/protected/public
访问权限: 继承关系:
- 【Windows】为节省系统资源,停掉不必要的服务
1.windows服务名称(注册表名称)和显示名称对照表如下: < 显示名称 状态 服务名称 Application Management demand AppMgmt ASP.NET Stat ...
- visualssh 是一个可视化的ssh客户端
这两个周末写了visualssh,一个可视化的ssh客户端.里面集成了putty的功能,通过ssh协议与Linux server通讯. 以后可以针对不同的应用编写相关插件,便于管理Linux服务器上的 ...