Table Border for an Iphone app
I am new to Iphone app 开发者_开发问答development. I have been trying to draw a border for my table in my iphone app. Most of the posts I see are how to remove the seperation lines between cells or change colors or add background.
I tried to do the following
- (void)viewDidLoad {
[super viewDidLoad];
self.tableView.layer.border = 1;
}
However, it says that the border is not an attribute.
It would be great if someone could help me out in this.
Perhaps you mean you'd like to display the table in 'Grouped' style, which adds a border?
[table setStyle:UITableViewStyleGrouped];
http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UITableView_Class/Reference/Reference.html
CALayer indeed does not have such property. What you need is borderColor
and borderWidth
精彩评论