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

来源:互联网 发布:web项目程序员个人简历 编辑:程序博客网 时间:2024/05/22 10:28

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 plaincopyprint?
  1. if ([m_tableView respondsToSelector:@selector(setSeparatorInset:)]) {  
  2.         [m_tableView setSeparatorInset:UIEdgeInsetsZero];  
  3.     }  


实现separatorStyle也是如此:

m_tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLineEtched;

0 0
原创粉丝点击