如何为UITableView iOS 7设置边框?

如何为UITableView iOS 7设置边框?,uitableview,ios7,ios7.1,Uitableview,Ios7,Ios7.1,iOS 7中的UITableView没有侧边框。我尝试了以下方法来更改边框颜色和宽度: tableView.layer.masksToBounds=YES; tableView.layer.borderWidth = 1.0f; tableView.layer.borderColor = [UIColor whiteColor].CGColor; 但我仍然无法获得UITableView的边界 tableView.separatorColor 即使设置此选项也无济于事。#导入 #import

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; 
tableView.layer.borderWidth=1.0f; tableView.layer.borderColor=[UIColor redColor].CGColor;
@ArunB:使用此代码可以创建UITableView的边框您是否导入了“QuartzCore/QuartzCore.h”框架