最大并发数网络请求超时的具体时间
- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock;
1.options-SDWebImageOptions
SDWebImageRetryFailed = 1 << 0,(默认情况下,当一个url下载失败,这个url就会加入黑名单,下次禁止尝试下载,这个参数禁止加入黑名单的操作)
/** * By default, image downloads are started during UI interactions, this flags disable this feature, * leading to delayed download on UIScrollView deceleration for instance. */ SDWebImageLowPriority = 1 << 1(默认情况下,在交互的时候图像也会下载,但是这个参数禁止ui交互时下载图像,例如在UIScrollView减速的时候延迟下载)
SDWebImageCacheMemoryOnly = 1 << 2,(仅使用内存缓存,废除磁盘下载)
SDWebImageProgressiveDownload = 1 << 3,(默认情况下,图像只会在下载完成的时候展示,这个参数可以使渐进式下载,图像会像在浏览器中一样,在下载的时候渐进的展示出来)
/** * Even if the image is cached, respect the HTTP response cache control, and refresh the image from remote location if needed. * The disk caching will be handled by NSURLCache instead of SDWebImage leading to slight performance degradation. * This option helps deal with images changing behind the same request URL, e.g. Facebook graph api profile pics. * If a cached image is refreshed, the completion block is called once with the cached image and again with the final image. * * Use this flag only if you can't make your URLs static with embedded cache busting parameter. */ SDWebImageRefreshCached = 1 << 4,(在url相同的时候,但是图片更新了,可以使用这个参数进行图片刷新)
/** * In iOS 4+, continue the download of the image if the app goes to background. This is achieved by asking the system for * extra time in background to let the request finish. If the background task expires the operation will be cancelled. */ SDWebImageContinueInBackground = 1 << 5,
/** * Handles cookies stored in NSHTTPCookieStore by setting * NSMutableURLRequest.HTTPShouldHandleCookies = YES; */ SDWebImageHandleCookies = 1 << 6,
/** * Enable to allow untrusted SSL certificates. * Useful for testing purposes. Use with caution in production. */ SDWebImageAllowInvalidSSLCertificates = 1 << 7,
/** * By default, image are loaded in the order they were queued. This flag move them to * the front of the queue and is loaded immediately instead of waiting for the current queue to be loaded (which * could take a while). */ SDWebImageHighPriority = 1 << 8, /** * By default, placeholder images are loaded while the image is loading. This flag will delay the loading * of the placeholder image until after the image has finished loading. */ SDWebImageDelayPlaceholder = 1 << 9,
/** * We usually don't call transformDownloadedImage delegate method on animated images, * as most transformation code would mangle it. * Use this flag to transform them anyway. */ SDWebImageTransformAnimatedImage = 1 << 10, /** * By default, image is added to the imageView after download. But in some cases, we want to * have the hand before setting the image (apply a filter or add it with cross-fade animation for instance) * Use this flag if you want to manually set the image in the completion when success */ SDWebImageAvoidAutoSetImage = 1 << 11
SDWebImageDecoder—对image的解码工作为什么对image进行解码不解码是用imageNamed来加载image,系统会默认在主线程立即进行图片的解码工作,生成控件可以直接使用的位图。大量调用imageNamed就会产生卡顿。解决方法:1.是用imageWithContentsOfFile2.把解码放到子线程中去
网友评论