故事板:自定义UITableView

时间:2012-04-09 13:05:26

标签: iphone ios xcode storyboard tableview

我在项目中使用了Storyboard。

如果我使用 h.-File我的代码

IImage * backgroundImage = [UIImage imageNamed:@"bg_image.png"];
UIImageView * backgroundView = [[UIImageView alloc] initWithImage:backgroundImage];
self.tableView.backgroundColor = [UIColor clearColor];
self.tableView.backgroundView = backgroundView;
self.tableView.separatorColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.2];

有没有办法在Interface Builder中进行这些自定义?

我猜不是。

所以我的第二个问题是,如果我使用代码,我如何保留我在Interface Builder中制作的Static cellsnavigation segues?只是省略委托方法将是无稽之谈。

我可以将所有东西放在一起吗?静态单元格,导航段和自定义背景?

谢谢!

1 个答案:

答案 0 :(得分:0)

嘿,我发布这里的代码希望它会帮助你

- (无效)CREATETABLE {

myTableView = [[UITableView alloc] initWithFrame:CGRectMake(0,132,320,350)样式:UITableViewStylePlain];

myTableView.delegate=self;
myTableView.dataSource=self;
myTableView.backgroundColor=[UIColor clearColor];
myTableView.separatorColor=[UIColor clearColor];
myTableView.tag=2;
[self.view addSubview:myTableView];
[myTableView release];

} 现在只需通过[self createTable]调用此方法;