📜  链接到图像视图 kotlin 代码示例

📅  最后修改于: 2022-03-11 14:53:32.046000             🧑  作者: Mango

代码示例1
val myUrl = "https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/8a0b71a4-d6c1-4653-ad4b-b8e8473bcbf0/dc0tbzm-c31abeb7-472b-48ef-9cca-bcb7acd91c1a.png/v1/fill/w_1024,h_1184,strp/chuva_png_made_in_picsart__by_hanjorafael_dc0tbzm-fullview.png?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7ImhlaWdodCI6Ijw9MTE4NCIsInBhdGgiOiJcL2ZcLzhhMGI3MWE0LWQ2YzEtNDY1My1hZDRiLWI4ZTg0NzNiY2JmMFwvZGMwdGJ6bS1jMzFhYmViNy00NzJiLTQ4ZWYtOWNjYS1iY2I3YWNkOTFjMWEucG5nIiwid2lkdGgiOiI8PTEwMjQifV1dLCJhdWQiOlsidXJuOnNlcnZpY2U6aW1hZ2Uub3BlcmF0aW9ucyJdfQ.eOHdPU1wB392WJhxntAj6K9_XMfu_Yc_mb7r6MIt6Xw"

        val imageView = findViewById(R.id.aqui) as ImageView

        Picasso.get()
            .load(myUrl)
            .resize(300, 300)
            .centerCrop()
            .into(imageView)