Problem with android glide asbitmap in baseadpter
天蓬老师
天蓬老师 2017-05-19 10:47:48
0
1
950

 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);

When processing the bitmap obtained by gilde in baseadpter, load it into it. . . Only the last item is displayed
However, if the bitemap is directly loaded into it without processing the bitmap, all will be displayed. . . Solve

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(1)
某草草

Already solved. . . Glide returns to view before the operation is completed

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!