首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >滑翔不显示图像

滑翔不显示图像
EN

Stack Overflow用户
提问于 2022-01-28 06:00:26
回答 1查看 896关注 0票数 1

你好,我试图在我的应用程序中添加一个配置文件图像,但是它没有显示图像,我得到了这个错误,我也试图添加用户适配器,它没有显示,我也不能解决这个问题,谢谢您的回答

错误消息

代码语言:javascript
复制
2022-01-28 08:32:18.553 28556-28556/com.example.travelinstam I/ViewTarget: Glide treats LayoutParams.WRAP_CONTENT as a request for an image the size of this device's screen dimensions. If you want to load the original image and are ok with the corresponding memory cost and OOMs (depending on the input size), use .override(Target.SIZE_ORIGINAL). Otherwise, use LayoutParams.MATCH_PARENT, set layout_width and layout_height to fixed dimension, or use .override() with fixed dimensions.
2022-01-28 08:32:18.568 28556-28556/com.example.travelinstam I/ViewTarget: Glide treats LayoutParams.WRAP_CONTENT as a request for an image the size of this device's screen dimensions. If you want to load the original image and are ok with the corresponding memory cost and OOMs (depending on the input size), use .override(Target.SIZE_ORIGINAL). Otherwise, use LayoutParams.MATCH_PARENT, set layout_width and layout_height to fixed dimension, or use .override() with fixed dimensions.
2022-01-28 08:32:18.742 28556-28556/com.example.travelinstam W/Glide: Load failed for gs://travelinstam2.appspot.com/placeholder.png with size [100x100]
    class com.bumptech.glide.load.engine.GlideException: Failed to load resource
2022-01-28 08:32:18.785 28556-28556/com.example.travelinstam W/Glide: Load failed for gs://travelinstam2.appspot.com/placeholder.png with size [100x100]
    class com.bumptech.glide.load.engine.GlideException: Failed to load resource

这里是我的代码

代码语言:javascript
复制
    private void userInfo(){
        DatabaseReference reference = FirebaseDatabase.getInstance().getReference("Users").child(profileid);
        reference.addValueEventListener(new ValueEventListener() {
            @Override
            public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
                if (getContext() == null){
                    return;
                }

                User user = dataSnapshot.getValue(User.class);

                Glide.with(getContext()).load(user.getImageurl()).into(image_profile);
                username.setText(user.getUsername());
                fullname.setText(user.getFullname());
                bio.setText(user.getBio());
            }

            @Override
            public void onCancelled(@NonNull DatabaseError databaseError) {

            }
        });

    }

我使用的是hdodenhof:circleimageview版本

代码语言:javascript
复制
implementation 'de.hdodenhof:circleimageview:3.1.0'

这里是我的布局代码

代码语言:javascript
复制
                <de.hdodenhof.circleimageview.CircleImageView
                    android:layout_width="80dp"
                    android:layout_height="80dp"
                    android:id="@+id/image_profile"/>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-01-28 07:30:58

我试图打开从您日志gs://travelinstam2.appspot.com/placeholder.png中提取的链接中的资源,但它失败了。

您检查了资源URL是否正确且可访问吗?

的回答:根据我们在评论部分的讨论,问题是提供给Glide.的网址。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70889416

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档