我有一个UIImageView试图加载图像,如果它不存在,我打电话下载图像。一旦图像被下载,NSNotification被发送并且UIImageView.image被设置为下载的图像。这是行得通的,但在图像设置为在UIImageView中显示后需要几秒钟。在图像下载完成后,再次发送通知,因此延迟不是图像的下载。UIImageView.image需要几秒钟时间通过NSNotification设置时显示
以下是通知:
- (void)recieveImageDownloadUpdate:(NSNotification *)notification {
if ([[item valueForKey:@"FlipBookPhotoID"] intValue] == imgView1.tag) {
// this loads the image if the tag on the UIImageView matches the notification update
imgView1.image = [Helpers getImageDownloadIfMissing:[[item valueForKey:@"PhotoName"] stringByReplacingOccurrencesOfString:@"_lg" withString:@""] withManufacturer:[item valueForKey:@"ManufacturerID"] withFlipBookID:[item valueForKey:@"FlipBookID"] withFlipBookPhotoID:[item valueForKey:@"FlipBookPhotoID"] shouldDownload:NO ];
}
}
所有这一切都与寻呼一个UIScrollView用于启用,如何获取这些图像的通知后,立即显示。
可以提供更多的细节... – Ali3n
有一吨的代码,只是想知道如果我需要调用强制屏幕更新 – Slee