简体   繁体   English

登录后FBProfilePictureView不显示个人资料图片

[英]FBProfilePictureView does not show profile picture after login

I am using Facebook IOS SDK to display profile pictures of a few friends. 我正在使用Facebook IOS SDK显示一些朋友的头像。 When the app is not signed-in, FBProfilePictureView can display different pictures by assigning profileIDs. 当应用未登录时,FBProfilePictureView可以通过分配profileID显示不同的图片。 However, it displays nothing when the app is associated with a signed-in user. 但是,当应用程序与登录用户相关联时,它什么也不显示。 Why? 为什么?

Thank you! 谢谢!

I had the same problem. 我有同样的问题。 If your app is designed like mine, you are likely setting the profileID in a callback that is executed once the FB user is logged in. The problem is the view controller doesn't know to update the FBProfilePictureView. 如果您的应用程序设计类似于我的应用程序,则可能会在FB用户登录后执行的回调中设置profileID。问题是视图控制器不知道更新FBProfilePictureView。 The solution I found was to just update the model user object in the callback by assigning the profileID to one of its properties. 我发现的解决方案是通过将profileID分配给其属性之一来仅在回调中更新模型用户对象。 You can then use that property to update the FBProfilePictureView's profileID property in the view controller's viewWillAppear property. 然后,您可以使用该属性在视图控制器的viewWillAppear属性中更新FBProfilePictureView的profileID属性。

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

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