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
相關(guān)文章:
1. Docker for Mac 創(chuàng)建的dnsmasq容器連不上/不工作的問題2. html5 - javascript讀取自定義屬性的值,有的能夠取到,有的取不到怎么回事??3. html - Python2 BeautifulSoup 提取網(wǎng)頁中的表格數(shù)據(jù)及連接4. python - PyCharm里的一個文件不小心忽略了wx包5. android - VideoView與百度Map沖突6. python - (2006, ’MySQL server has gone away’)7. 小白學python的問題 關(guān)于%d和%s的區(qū)別8. python - 使用eclipse運行django代碼,修改了views.py這個文件,但是瀏覽器顯示的還是原有沒修改的結(jié)果,怎么處理?9. django - pycharm 如何配置 python3 的開發(fā)環(huán)境?10. win10 Apache24+PHP8.0,Apache不能正常加載php.ini。
