I've experienced some really weird behavior with UILabels in a UICollectionViewCell today and I'm hoping one of you guys can shed a light on this.
I can't show you code or full screenshots, but I will try to explain and illustrate it as well as possible;
I have a UICollectionView that has several cells and supports horizontal scrolling.
In the cells I have a label that I set on
- (UICollectionViewCell *)collectionView:(UICollectionView *)cv cellForItemAtIndexPath:(NSIndexPath *)indexPath
and clear on - (void)prepareForReuse
.
Seems pretty normal, and I even have an implementation exactly like this that works without any weirdness.
Now, for performance reasons, I set the UILabel's opaqueness ON in Interface Builder. When I scroll around a couple of times, I get to see this:
Whenever I turned opaque OFF in Interface Builder, I get to see this:
I have a lot of experience with UITableViews and UICollectionViews (and reusing, etc) but there is no way I can explain this behavior properly...