首页  >  问答  >  正文

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>() {                @Override                public 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进去则全部显示。。。求解

天蓬老师天蓬老师2733 天前956

全部回复(1)我来回复

  • 某草草

    某草草2017-05-19 10:49:48

    已经解决。。。glide的未操作完成便返回view

    回复
    0
  • 取消回复