I'm using Picasso, and I need to have a background (fixed) on also ImageView and an image from an URL. (android:background and android:src on XML)

However it seems that whenever I set a URL to be downloaded onto my imageview using picasso, my background is lost.

有帮助吗?

解决方案

Yes you can, Picasso only sets the image on the 'src', not the background..what might be happening is that your downloaded image is taking up all the space and you're not seeing the background. To quickly check if this is the case, try adding a android:padding="20dp" to the ImageView and you will see if this is the case.

In this case, you will ensure that you will always see the background behind, at least part of it..so it will help you debugging your case.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top