简体   繁体   English

有没有办法更改Facebook的FBProfilePictureView默认注销个人资料图像?

[英]Is there a way to change Facebook's FBProfilePictureView Default Logged Out Profile Image?

I have an iOS game that I'm working on that uses Facebook Login and FBProfilePictureView to add the user's profile photo to the game when they are logged in. When they are not logged in, the default Facebook Profile image shows instead. 我正在使用一个iOS游戏,该游戏使用Facebook登录名和FBProfilePictureView在用户登录时将其个人资料照片添加到游戏中。如果未登录,则显示默认的Facebook个人资料图像。 Is there a way to customize or change that logged out default image to something else? 是否可以自定义或将注销的默认图像更改为其他图像?

Here's an example of the image that I want to change. 这是我要更改的图像的示例。

默认Facebook图像示例

I created an improved version of FBProfilePictureView here . 我在这里创建了FBProfilePictureView的改进版本。 This allows you to specify the not logged in image directly. 这使您可以直接指定未登录的图像。

DBFBProfilePictureView *facebookPictureView = [[DBFBProfilePictureView alloc] initWithFrame:CGRectMake(x,y,width,height)];
facebookPictureView.emptyImage = customImage;

FBProfilePictureView is a subclass of UIView. FBProfilePictureView是UIView的子类。 To put a custom picture in it you can use 要将自定义图片放入其中,您可以使用

profilePictureView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"someImage"]];

if the image is included in the project. 如果图像包含在项目中。

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

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