UELabel and UILabel color changes in iOS 7

I see something really strange in my UITableViewCells containing UILabels with ellipsis (this project is only for iOS 7). I see an ellipsis when I first load a tableView. Then, if I click on a cell, the colors of the text + ellipsis change in the same way as I ask for it in my setHighlighted function. But when I turn it off (when I went to the viewController details and returned to the first viewController with a table view or just clicked and then scrolled to release the selection), the ellipsis will disappear.

In fact, I found out that he is still there, just that he is white on a white background (highlight color for text, see code below). For a better understanding, here are screens showing what I just described:

Before clicking:

Before clicking

The cell is highlighted when we click:

The cell is highlighted

After clicking, going to the next viewController and pressing back:

After clicking, moving to the next viewController and pressing back

Please note that if I click + release the selection by scrolling, only the selected cell loses the ellipsis. In addition, when scrolling through the tableView, everything is fine until I get to the bottom of it and load the following list items - then all the ellipsis will remain white (as well as the selected highlighted font, which is highlighted in bold). This led me to believe that it was caused by something done while reloading these cells.

Here is the setHighlighted code:

-(void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated { NSUInteger fontSize = _titleLabel.font.pointSize; [UIView animateWithDuration:(highlighted ? .2 : .5) delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{ _background.backgroundColor = (highlighted ? [UIColor blueND] : [UIColor whiteColor]); _hourLabel.textColor = (highlighted ? [UIColor whiteColor] : [UIColor blackColor]); _titleLabel.textColor = (highlighted ? [UIColor whiteColor] : [UIColor blackColor]); _titleLabel.font = (highlighted ? [UIFont boldSystemFontOfSize:fontSize] : [UIFont systemFontOfSize:fontSize]); _consoleLabel.textColor = (highlighted ? [UIColor blueND] : [UIColor whiteColor]); _consoleLabel.backgroundColor = (highlighted ? [UIColor whiteColor] : [UIColor blueND]); } completion:nil]; } 

Does anyone know what is going on here?

Thanks for your help in advance!

Update: after a comment from Leo Natan, here is the result fo po _titleLabel.attributedString for the selected cell, as soon as it was selected, then released:

 (lldb) po _titleLabel.attributedText Mario Golf : World Tour, le Lagon Cheep Cheep en vidΓ©o{ NSColor = "UIDeviceWhiteColorSpace 0 1"; NSFont = "<UICTFont: 0x1669a990> font-family: \".HelveticaNeueInterface-Regular\"; font-weight: normal; font-style: normal; font-size: 14.00pt"; NSParagraphStyle = "Alignment 0, LineSpacing 0, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 4, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (null), Lists (null), BaseWritingDirection -1, HyphenationFactor 0, TighteningFactor 0, HeaderLevel 0"; NSShadow = "NSShadow {0, -1} color = {(null)}"; } 
+7
uilabel uitableview ellipsis ios7 textcolor
source share
2 answers

This is probably a system error. Be sure to open the error report.

As pointed out in the comments, instead of manually setting the colors, you can use highlightedTextColor labels and selectedBackgroundView cells to achieve what you are trying to do.

+6
source share

It seems to be an apple bug. I reported an error (# 19061268) on apple.

The current workaround that I see is to set the attribute text property with the desired color, and not set the text property.

0
source share

All Articles