mirror of https://github.com/opa334/TrollStore.git
Attempt to fix icons bugging out
This commit is contained in:
parent
f5a2dfae01
commit
b6579c6a09
|
@ -375,14 +375,15 @@ UIImage* imageWithSize(UIImage* image, CGSize size)
|
||||||
cell.imageView.image = _placeholderIcon;
|
cell.imageView.image = _placeholderIcon;
|
||||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^
|
||||||
{
|
{
|
||||||
//usleep(1000 * 5000); // (test delay for debugging)
|
|
||||||
UIImage* iconImage = imageWithSize([UIImage _applicationIconImageForBundleIdentifier:appId format:iconFormatToUse() scale:[UIScreen mainScreen].scale], _placeholderIcon.size);
|
UIImage* iconImage = imageWithSize([UIImage _applicationIconImageForBundleIdentifier:appId format:iconFormatToUse() scale:[UIScreen mainScreen].scale], _placeholderIcon.size);
|
||||||
_cachedIcons[appId] = iconImage;
|
_cachedIcons[appId] = iconImage;
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
if([tableView.indexPathsForVisibleRows containsObject:indexPath])
|
NSIndexPath *curIndexPath = [NSIndexPath indexPathForRow:[_cachedAppInfos indexOfObject:appInfo] inSection:0];
|
||||||
|
if([tableView.indexPathsForVisibleRows containsObject:curIndexPath])
|
||||||
{
|
{
|
||||||
cell.imageView.image = iconImage;
|
UITableViewCell *curCell = [tableView cellForRowAtIndexPath:curIndexPath];
|
||||||
[cell setNeedsLayout];
|
curCell.imageView.image = iconImage;
|
||||||
|
[curCell setNeedsLayout];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue