Skip to content

画像リクエスト

ImageRequestは、値オブジェクトであり、ImageLoaderが画像を読み込むために必要なすべての情報を提供します。ImageRequestはビルダーを使用して作成できます。

kotlin
val request = ImageRequest.Builder(context)
    .data("https://example.com/image.jpg")
    .crossfade(true)
    .target(imageView)
    .build()

リクエストを作成したら、それをImageLoaderに渡してキューに入れるか実行します。

kotlin
imageLoader.enqueue(request)

詳細については、APIドキュメントを参照してください。