문제

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. 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.

Example of the Default Facebook Image

도움이 되었습니까?

해결책 2

FBProfilePictureView is a subclass of 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.

다른 팁

I created an improved version of FBProfilePictureView here. This allows you to specify the not logged in image directly.

DBFBProfilePictureView *facebookPictureView = [[DBFBProfilePictureView alloc] initWithFrame:CGRectMake(x,y,width,height)];
facebookPictureView.emptyImage = customImage;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top