您的位置:首页 > 移动开发 > IOS开发

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

2014-08-06 15:30 344 查看


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

原文链接:/article/2040011.html

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

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

[m_tableView setSeparatorInset:UIEdgeInsetsZero];

}

实现separatorStyle也是如此:

m_tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLineEtched;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: