2016-03-19 13 views
0

我使用滑行加载ListView中(ImageView的高度和宽度的是WRAP_CONTENT)机器人:在ListView的图像加载问题通过使用滑行

代码图像

Glide.with(context).load(rowItem.getPosteduserpostimage()).error(R.drawable.bg_480_800).placeholder(R.drawable.loading_img).into(holder.ivPostedImage); 

当它装在我第一次得到正确的图像(见图片)

enter image description here

SC后滚动,当我再次观看相同的图像它的出现就像

enter image description here

那么,如何显示滚动也

注后的实际图像:我ImageView的高度和宽度的是WRAP_CONTENT

编辑 对不起,我忘了提,我使用的RelativeLayout

内的ImageView

XML代码

<RelativeLayout 
      android:id="@+id/rl_lv_user_post_adapter_img_holder" 
      android:layout_width="match_parent" 
      android:layout_height="250dp" 
      android:layout_below="@+id/tv_user_posted_msg_post_items" > 

      <ImageView 
       android:id="@+id/iv_posted_img" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_centerInParent="true" 
       android:background="#ffffff" 
       android:contentDescription="@string/cont_desc"/> 
     </RelativeLayout> 

回答

0

我改变了XML这样的代码

<RelativeLayout 
      android:id="@+id/rl_lv_user_post_adapter_img_holder" 
      android:layout_width="match_parent" 
      android:layout_height="300dp" 
      android:layout_below="@+id/tv_user_posted_msg_post_items" > 

      <ImageView 
       android:id="@+id/iv_posted_img" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:layout_centerInParent="true" 
       android:scaleType="fitCenter" 
       android:background="#ffffff" 
       android:contentDescription="@string/cont_desc"/> 
     </RelativeLayout> 

然后它的正常工作

0

@kiran卸下

android:layout_centerInParent="true" 

实际上是所述一个壳体的问题,并放置在图像中中心。