2016-03-19 2 views
0

を使用して、リストビューでの画像の読み込みの問題私は、リストビューで画像をロードするためにグライドを使用しています(ImageViewの高さと幅のはwrap_contentある)アンドロイド:グライド

コード

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

それはでロードしています私が正しく画像を取得しています最初の時間は、SCの後

enter image description here

(画像を参照します)マイImageViewの高さと幅のは

をwrap_contentている:私は再び同じ画像を見ている時に転がり、だから、どのようにもスクロール

注後の実際の画像を表示するように

enter image description here

のように表示されています私が言及するのを忘れてしまった

編集 申し訳ありませんが、私はRelativeLayout

内ImageViewのを使用しています

XMLコード

答えて

0

私はそれが罰金

を働いているこの

<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> 

のようなXMLコードを変更

0
<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> 

android:layout_centerInParent="true" 

を削除@kiran実際には一つの問題をケーシングと中央に画像を配置することです。

関連する問題