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>
是否存在与行间图像交换有关的问题? – dwbrito 2013-02-11 12:01:35
我现在不记得了。我进入了一个更精简的图书馆。 – 2013-02-13 20:26:31
我有点纠正了我的“droid-fu”(点火)问题。 – dwbrito 2013-02-14 09:53:10