android - ImageView Only Appears When Setting Background in XML - Not Using Picasso -


i have strange situation. have imageview (imageview1) should populated image using picasso:

imageview imageitem = (imageview) findviewbyid(r.id.imageview1); picasso.with(this).load(boxart)                 .fit().centerinside().into(imageitem); 

for strange reason - imageview not populate when using picasso - add background via xml: android:background="@drawable/boxart" both show - don't understand.

xml:

http://pastebin.com/yuxxaxql

screenshot:

with android:background="@drawable/boxart" - http://imgur.com/7nmvdct without android:background="@drawable/boxart" - http://imgur.com/unqowhp 

any suggestions appreciated.

it looks similar other issues: https://github.com/square/picasso/issues/457

since using wrap_content, , don't have content on imageview, renders height=0 when loading image picasso, set fit(), adjusts new image imageview size. since height 0, nothing renders.

some things can do:

  1. if using older version, update picasso latest version.
  2. make imageview match_parent desired size.

Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -