android glide asbitmap 在baseadpter中的問題
問題描述
public View getView( final int position, View convertView, ViewGroup parent) { View view=convertView; if (view==null){view=layoutInflater.inflate(R.layout.lable,null); } imageview=new ImageView(getContext()); imageview= (ImageView) view.findViewById(R.id.listimageview); SimpleTarget target = new SimpleTarget<Bitmap>() {@Overridepublic void onResourceReady(Bitmap bitmap, GlideAnimation glideAnimation) { Drawable drawable = new BitmapDrawable(bitmap); Bitmap bitmap1 = ((BitmapDrawable)drawable).getBitmap(); Bitmap reflectedBitmap = BitmapUtil.createReflectedBitmap(bitmap1); BitmapDrawable drawable1 = new BitmapDrawable(reflectedBitmap); drawable1.setAntiAlias(true); imageview.setImageDrawable(drawable1);} }; Glide.with(getContext()).load(getItem(position).imgurl).asBitmap().into(target); //Glide.with(getContext()).load(getItem(position).imgurl).into(imageview);
當在baseadpter中處理gilde得到的bitmap再加載進去。。。只有最后一個item才顯示然而不處理bitemap直接loadinto進去則全部顯示。。。求解
問題解答
回答1:已經(jīng)解決。。。glide的未操作完成便返回view
相關文章:
1. python - 獲取到的數(shù)據(jù)生成新的mysql表2. javascript - js 對中文進行MD5加密和python結果不一樣。3. mysql里的大表用mycat做水平拆分,是不是要先手動分好,再配置mycat4. window下mysql中文亂碼怎么解決??5. sass - gem install compass 使用淘寶 Ruby 安裝失敗,出現(xiàn) 4046. python - (初學者)代碼運行不起來,求指導,謝謝!7. 為啥不用HBuilder?8. python - flask sqlalchemy signals 無法觸發(fā)9. python的文件讀寫問題?10. 為什么python中實例檢查推薦使用isinstance而不是type?
