实现iOS7上tableView的分割线像iOS6中的效果

来源:互联网 发布:僵尸变脸软件下载 编辑:程序博客网 时间:2024/05/21 18:20

实现iOS7上tableView的分割线像iOS6中的效果

原文链接:http://blog.csdn.net/quanqinyang/article/details/38385277

iOS7上tableView的分割线左边短了一点,要实现和iOS6中的效果还是有方法的,UITableView头文件里个属性:

@property (nonatomic)         UIEdgeInsets                separatorInsetNS_AVAILABLE_IOS(7_0)UI_APPEARANCE_SELECTOR// allows customization of the frame of cell separators


在viewDidLoad里实现如下代码:

[objc] view plaincopy
  1. if ([m_tableView respondsToSelector:@selector(setSeparatorInset:)]) {  
  2.         [m_tableView setSeparatorInset:UIEdgeInsetsZero];  
  3.     }  


实现separatorStyle也是如此:

m_tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLineEtched;

0 0