简体   繁体   English

FBLoginView按钮平铺

[英]FBLoginView Button Tiling

I have implemented FBLoginView on my previous version of my iOS app, suited for iOS 6&7. 我已经在适用于iOS 6和7的iOS应用的早期版本中实现了FBLoginView 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. 最近,在iOS 8发布之后,我将我的Facebook Framework升级到了最新版本,以下是实现相同FBLoginView按钮的结果。

I tried using the previous version of the Facebook Framework, but I still experience the same problem. 我尝试使用早期版本的Facebook Framework,但仍然遇到相同的问题。

Below is the implementation if the FBLoginView programmatically in my code 如果在我的代码中FBLoginView编程方式使用FBLoginView ,则以下是实现

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问题

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 然后,剩下的代码可以在声明了FBLoginViewDelegate的委托中

There is an example named HelloFacebookSDK in FacebookSDK for your reference. FacebookSDK中有一个名为HelloFacebookSDK的示例供您参考。

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

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