Listview 自定义列表视图上的毕加索显示内存不足
我正在使用毕加索从assets floder加载图片,其中大约有900张图片。但是当我滑动ListView时,logcat会出现在内存中 我的自定义listrow places_layout.xml:Listview 自定义列表视图上的毕加索显示内存不足,listview,picasso,Listview,Picasso,我正在使用毕加索从assets floder加载图片,其中大约有900张图片。但是当我滑动ListView时,logcat会出现在内存中 我的自定义listrow places_layout.xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="mat
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_test"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"/>
</RelativeLayout>
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder=null;
if(convertView==null){
holder=new ViewHolder();
convertView= LayoutInflater.from(mContext).inflate(R.layout.list_item,null);
holder.mImageView=(ImageView)convertView.findViewById(R.id.iv_test);
convertView.setTag(holder);
}else {
holder=(ViewHolder)convertView.getTag();
}
Picasso.with(mContext).load("file:///android_asset/picture/" + mPictureNames.get(position)).resize(200,200).into(holder.mImageView);
// holder.mImageView.setImageBitmap(getPicture(position));
return convertView;
}