【问题标题】:UI control not display content in custom tableviewcell with storyboardUI控件不在带有情节提要的自定义tableviewcell中显示内容
【发布时间】:2015-01-16 03:02:58
【问题描述】:

我不明白为什么在使用 IOS8 和 XCODE 6.1.1 运行应用程序时我在故事板中的标签不显示 我已将我的标签绑定到自定义 UiTableviewCell 并且我可以设置文本,但我的标签不会出现在tableView dequeueReusableCellWithIdentifier:CellIdentifier];返回的单元格内容视图的子视图中@

如果使用[self.tableView registerClass:[NewGameCell class] forCellReuseIdentifier:@"ListNewGameCell"]; 我无法使用情节提要。

我阅读了所有其他问题,但找不到答案。 谢谢

【问题讨论】:

  • 你知道为什么我的 UiLabel 没有在自定义单元的控制器中初始化吗?

标签: uitableview storyboard custom-controls reuseidentifier registerclass


【解决方案1】:

试试这个....

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    YourCustomCell *cell = (YourCustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
    return cell;
}

【讨论】:

    【解决方案2】:

    好吧,我太笨了!

    UILabel 没有出现,因为我只为 iPad 添加它,而我的模拟器在 iPhone 上。 感谢您的帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-07-22
      • 2012-07-05
      • 2015-08-21
      • 2012-05-09
      • 1970-01-01
      • 2013-09-30
      • 2020-05-07
      • 1970-01-01
      相关资源
      最近更新 更多