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

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

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


在viewDidLoad里实现例如以下代码:

if ([m_tableView respondsToSelector:@selector(setSeparatorInset:)]) {
        [m_tableView setSeparatorInset:UIEdgeInsetsZero];
    }


实现separatorStyle也是如此:

m_tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLineEtched;


看曾宪华开源码中实现的效果,感谢开源

原文地址:https://www.cnblogs.com/brucemengbm/p/6915108.html