您好,我在 Storyboard 的 ControllerA 中创建了 UITableViewCell。我需要在不同的 ControllerB 中使用相同的 UITableViewcell。我只需要通过 Storyboard 来实现这一点。 知道我该怎么做吗?
最佳答案
你可以像下面这样使用它:-
在 Storyboard中,您必须将另一个 Table-cell 放入 ControllerB nib 中,并为其提供您想要的类似自定义单元格的类名,如下所示:-
和
你的 ControllerB 的 cellForRowAtIndexPath
看起来像这样
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
Members_Cell *cell = [tableView dequeueReusableCellWithIdentifier:@"Members_Cell"];
cell.lblMemberName.text=[ArrSearchResult objectAtIndex:indexPath.row];
return cell;
}
关于ios - 如何在不同的 UItableViewController 中重用 Storyboard 中创建的 UITableViewCell View ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18380682/