我需要一些帮助以编程方式对齐 facebook 登录按钮。 这是 facebook sdk 为您提供的代码,并将其放在 Storyboard顶部的中央。
我想将它对齐到 Storyboard底部的特定位置。这是 SDK 放置它的位置:http://i.imgur.com/HN08YqN.png ......这是我想放的地方:http://i.imgur.com/JWECyr0.png
谢谢各位。
//Facebook Login Button
FBLoginView *loginView = [[FBLoginView alloc] init];
// Align the button in the center horizontally
loginView.frame = CGRectOffset(loginView.frame, (self.view.center.x - (loginView.frame.size.width / 2)), 5);
[self.view addSubview:loginView];
最佳答案
尝试设置 center
属性而不是框架。我就是这样做的。
loginView.center = CGPointMake(selfWidth /2, selfHeight - 40);
关于ios - Facebook 登录按钮对齐 iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24955774/