cell.detailTextLabel.text不工作......为什么 [英] cell.detailTextLabel.text not working... why

查看:95
本文介绍了cell.detailTextLabel.text不工作......为什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用以下代码我得到text.label但不是detailTextLabel.text。 NSLog正确显示。

Using the following code I am getting the text.label but not the detailTextLabel.text. The NSLog is displaying correctly.

cell.textLabel.text = [eventLabels objectAtIndex:indexPath.row];  
cell.detailTextLabel.text = [eventFields objectAtIndex:indexPath.row]];  

NSLog(@"%@", [eventFields objectAtIndex:indexPath.row]);  

我也试过......

I also tried...

cell.detailTextLabel.text = [NSString stringWithFormat:@"%@", [eventFields objectAtIndex:indexPath.row]];     

我以前没遇到过这个问题。有什么建议吗?

I have not had problems with this before. Any suggestions?

John

推荐答案

确保你正在使用一个适当的 UITableViewCellStyle 这个(除了 UITableViewCellStyleDefault 因此应该有效)。初始化时指定了单元格的样式。

Make sure you're using an appropriate UITableViewCellStyle with this (anything but UITableViewCellStyleDefault should thus work). The cell's style is specified when you initialize it.

这篇关于cell.detailTextLabel.text不工作......为什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆