2011-04-26 71 views
1

有人可以告訴我爲什麼即使從Droidfu緩存中抓取圖像,該GridView也不能平滑滾動嗎?Droidfu WebImageView和GridView

我試過WebImageView,我自己的默認處理程序與ImageLoader,刪除了sqlLite調用,只是使用靜態URL,試圖隱藏和加載後圖像淡入淡出等。似乎無法順利滾動(越來越圖像跳動)。 DroidFu是造成這種情況的原因嗎?因爲我已經投資了Droidfu,所以我不願意拋棄Droidfu。插入到GridView中的本地圖像資源顯然很好地滾動。我在這個問題上花了太長時間。

public View getView(int position, View convertView, ViewGroup parent) { 

     mCursor.moveToPosition(position); 

     String thumbUrl=imagePath+mCursor.getString(mCursor.getColumnIndex("imagename")); 
     if (convertView == null) { 
      convertView=(View)mInflater.inflate(R.layout.grid_thumb_layout, null); 
     } 
     WebImageView thumb=(WebImageView)convertView.findViewById(R.id.thumb); 
     thumb.reset(); 
     thumb.setImageUrl(thumbUrl); 
     thumb.loadImage(); 
     return convertView; 

    } 

XML:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent"> 
<GridView android:id="@+id/gridview" android:layout_width="fill_parent" 
    android:layout_height="fill_parent" android:numColumns="auto_fit" 
    android:verticalSpacing="2dp" android:horizontalSpacing="2dp" 
    android:columnWidth="150dp" 
    android:rowHeight="150dp" 
    android:fadingEdge="vertical" 
    android:paddingLeft="2dp" android:paddingRight="2dp" 
    android:gravity="center" /> 
</RelativeLayout> 


<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:layout_width="150dp" 
android:layout_height="150dp"> 
<com.github.droidfu.widgets.WebImageView android:id="@+id/thumb" 
    android:scaleType="fitCenter" android:layout_weight="1" 
    android:layout_width="150dp" 
    android:layout_height="150dp" xmlns:android="http://schemas.android.com/apk/res/android" > 
</com.github.droidfu.widgets.WebImageView> 
</RelativeLayout> 

回答

0

嘗試用RemoteImageView這是由同一作者的點火項目同級更換WebImageView

根據this,Droid-Fu的開發將停止,它將被重新命名爲Ignition

點火有一個類似的類叫RemoteImageView。用法基本相同,但似乎他們已經重新修改了後端,所以它的緩存響應更好。我試着用一個ListView來給永久加載的問題。爲我工作(雖然它引入了一些其他問題,但他們似乎很小)。

+0

是否存在與行間圖像交換有關的問題? – dwbrito 2013-02-11 12:01:35

+0

我現在不記得了。我進入了一個更精簡的圖書館。 – 2013-02-13 20:26:31

+0

我有點糾正了我的「droid-fu」(點火)問題。 – dwbrito 2013-02-14 09:53:10