FBLoginView Button Tiling

180 views Asked by At

I have implemented FBLoginView on my previous version of my iOS app, suited for iOS 6&7. Recently, after the iOS 8 release, I upgraded my Facebook Framework to the latest version and below is the result of implementing the same FBLoginView button.

I tried using the previous version of the Facebook Framework, but I still experience the same problem.

Below is the implementation if the FBLoginView programmatically in my code

self.fbBtn = [[FBLoginView alloc] init];
self.fbBtn.frame = CGRectZero;
self.fbBtn.readPermissions = @[@"public_profile", @"email"];
self.fbBtn.delegate = [FacebookDelegateHelper sharedObject];
[self addSubview:self.fbBtn];
[self.fbBtn setTranslatesAutoresizingMaskIntoConstraints:NO];

What am I doing wrong?

FBloginView issue

1

There are 1 answers

1
B-HigH On

The one that work would be:

FBLoginView *loginView = [[FBLoginView alloc] init];
loginView.frame = CGRectMake(x, y, w, h);    // Your fbButton position
loginView.delegate = [FacebookDelegateHelper sharedObject];
[loginView siazeToFit];
[self addSubview:loginView];

This should make your button appear. Then the rest of your code could be in your delegate where FBLoginViewDelegate has been declared

There is an example named HelloFacebookSDK in FacebookSDK for your reference.