正确设置虽然与iOS 5.1的工作程序模拟器感觉很棒,但测试它在iOS 4.3模拟器后某种不知所云的问题出现了:的UILabel文字颜色不的iOS 4.3
我使用自定义的UITableViewCell的UITableView的,并它有几个UILabels和一个UITextView。问题是,textColor属性似乎根本不起作用 - 尽管显示了背景并且NSLog打印了正确的文本,但我的标签上的所有文本仍然不可见。我试图改变IB和编程方式的textColor值,但都没有帮助。
怎么样UITextView - 没关系。我猜,我可以用textViews替换所有的标签,但这不是编程的好方法,是吗?
对于你的任何帮助,我都会感激不尽,因为它只是把我的思绪抛开!
更新(添加源代码)
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
FeedItemCell *cell = [tableView dequeueReusableCellWithIdentifier:[FeedItemCell cellID]];
if (!cell) {
cell = [FeedItemCell cell];
}
NSIndexPath *selectedPath = [tableView indexPathForSelectedRow];
if (selectedPath && (indexPath.row == selectedPath.row)) {
[self selectRowAtIndexPath:indexPath];
}
[cell fillWithContents:[feedItemsController.fetchedObjects objectAtIndex:indexPath.row]];
return cell;
}
//---
@implementation FeedItemCell
- (void)fillWithNewsItemContents:(FeedItem *)feedItem {
self.nameLabel.text = [feedItem.creator fullName];
self.dateLabel.text = [TimeFormatter newsTimeWithDate:feedItem.postedDate];
self.detailTextView.text = [FeedItemCell detailTextViewStringFromFeedItem:feedItem];
self.commentLabel.text = [self _commentsTitleWithNews:feedItem];
self.avatarImageView.image = [feedItem.creator avatar];
}
所有UILabel
s的在xib
-file
我想这将是你的一部分的一些愚蠢的错误。你能告诉我们代码吗? – Sulthan 2012-07-31 17:11:44