<GCKUIImageCache> 协议
定义检索和缓存图片的方法的协议。
框架在内部使用默认实现来缓存显示在界面中的媒体图片。应用可以通过设置 GCKCastContext::imageCache 属性来提供自定义实现。
- 开始时间
- 3.0
此类继承 <NSObject>。
- (void) fetchImageForURL: |
|
(NSURL *) |
imageURL |
completion: |
|
(void(^)(UIImage *_Nullable)) |
completion |
|
|
| |
获取指定网址上的图片,并返回图片的缩放版本。
这是一项异步操作。
- Parameters
-
imageURL | The URL of the image. |
completion | A block to invoke once the image has been retrieved. The image should be passed to the block. If there was an error retrieving the image, nil should be passed instead. The block should only be invoked on the main thread. |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-01。
[null,null,["最后更新时间 (UTC):2023-12-01。"],[[["The `GCKUIImageCache` protocol defines how images are retrieved and cached for display within the Google Cast framework."],["Developers can customize image caching by providing their own implementation and setting it on the `GCKCastContext`."],["The `fetchImageForURL:completion:` method retrieves and scales images asynchronously, notifying the caller via a completion block on the main thread."]]],[]]