小编Val*_*cia的帖子

毕加索与Kotlin的回呼

我正在用Kotlin制作一个Android应用程序,需要使用Picasso下载图像。我在下面看到了用于将动画设置为图像的Java代码,但是我无法将其转换为Kotlin,因为我不知道如何在“转为”功能中设置回调。

Picasso.with(MainActivity.this)
       .load(imageUrl)
       .into(imageView, new com.squareup.picasso.Callback() {
                    @Override
                    public void onSuccess() {
                        //set animations here

                    }

                    @Override
                    public void onError() {
                        //do smth when there is picture loading error
                    }
                });
Run Code Online (Sandbox Code Playgroud)

有人能帮我吗 ?

我的实际代码:

Picasso.with(context)
       .load(url)
       .into(imageDiapo, com.squareup.picasso.Callback)
Run Code Online (Sandbox Code Playgroud)

android kotlin picasso

1
推荐指数
2
解决办法
1275
查看次数

标签 统计

android ×1

kotlin ×1

picasso ×1