简体   繁体   English

将Glide图片更新到ImageView

[英]Updating Glide image into ImageView

I have two screens of the app.One is edit screen and another is modify screen.I am loading the images into list using Glide in edit screen with 100*100 size successfully using below code. 我有两个应用程序屏幕,一个是编辑屏幕,另一个是修改屏幕。我使用下面的代码成功地使用Glide在100 * 100大小的编辑屏幕中将图像加载到列表中。

public static void loadEditImage(ImageView view, String imageUrl){
        Glide.with(view.getContext())
                .load(imageUrl)
                .transform(new CircleTransform(mContext))
//                .placeholder(R.drawable.car_logo_bg)
                .override(600, 200)

                .diskCacheStrategy(DiskCacheStrategy.NONE)
                .skipMemoryCache(true)
                .into(view);
    }

Same image i am trying to display in modify screen with 140*140 size using same image URL. 我试图使用相同的图像URL在140 * 140尺寸的修改屏幕中显示相同的图像。 But the image its displaying the size with 100*100 instead of 140*140. 但是图像显示的尺寸为100 * 100,而不是140 * 140。 Below glide code is using for this screen. 以下滑行代码用于此屏幕。

public static void loadModifyImage(ImageView view, String modifyImageUrl){
        Glide.with(view.getContext())
                .load(modifyImageUrl)
                .asBitmap()
                .transform(new CircleTransform(mContext))
//                .placeholder(R.drawable.car_logo_bg)
                .override(600, 200)

//                .centerCrop()
//                .fitCenter()
                .diskCacheStrategy(DiskCacheStrategy.NONE)
                .skipMemoryCache(true)
                .signature(new StringSignature(String.valueOf(System.currentTimeMillis())))
                .into(view);
    }

Please let me know if i am doing anything wrong and help me to display the image with the size of 140*140. 如果我做错任何事情,请告诉我,并帮助我显示尺寸为140 * 140的图像。

尝试

imageview.setLayoutParams(140, 140);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM