显示用户的photoURL

时间:2016-10-20 17:16:28

标签: firebase firebase-authentication firebaseui

我是Firebase(网络)的新用户,并尝试在img标记的视图中显示用户的photoURL。类似的东西:

通过id获取元素并更改src属性的JavaScript是什么?

我使用的是此处的基本示例: https://github.com/firebase/FirebaseUI-Web#using-firebaseui-for-authentication

谢谢,

2 个答案:

答案 0 :(得分:0)

您必须向Build.Gradle(App Level)文件添加新的依赖项:

compile 'com.github.bumptech.glide:glide:3.7.0'

比创建ImageView。 您现在可以使用FirebaseUsers PhotoURL设置ImageView的src:

ImageView iw = find.....

Glide.with(this).load(*).centerCrop().override(512, 512).into(iw);

* Can you replace with the current User (z.B : mFirebaseUser.getPhotoUrl().toString() )

多数人。

答案 1 :(得分:0)

document.getElementById('imgId').src= firebase.auth().currentUser.photoURL;
相关问题