如何为 UITableView iOS 7 设置边框



iOS 7 中的 UITableView 没有侧边框。我尝试了以下方法来更改边框颜色和宽度:

tableView.layer.masksToBounds=YES;
tableView.layer.borderWidth = 1.0f;
tableView.layer.borderColor = [UIColor whiteColor].CGColor; 

我仍然没有得到UITableView的边框。

tableView.separatorColor

即使设置这个也无济于事。

#import <QuartzCore/QuartzCore.h>
tableView.layer.borderWidth = 1.0f;
tableView.layer.borderColor = [UIColor redColor].CGColor; 

最新更新