没有nib文件或故事板的UITableViewCell模板

时间:2015-06-26 09:14:53

标签: ios

我想分开代码来决定单元格如何从UITableViewCell类显示以便在运行时重用或切换模板。像这样:

-(void)setTemplate:(MyTemplate *)template {
    [self.productName setStyleFrom:template.mainLabel];
    ....
}

我不想使用nib文件或故事板,仅限代码。

谢谢。

1 个答案:

答案 0 :(得分:2)

You can use Prototype Cell if you Don't want to add Cell through .xib or class which is derived from UITableview cell

Click the link for Prototype cell http://www.raywenderlich.com/50308/storyboards-tutorial-in-ios-7-part-1

相关问题