Is there a way to force the Facebook Login Button so it displays "Log in" as opposed to "Log in with Facebook"? Below is what it looks like on an iPhone 6
And below on an iPhone 6 Plus
I have briefly looked at the Facebook SDK on Github and have failed to come up with a solution. Facebook basically looks at the width of the button then displays the appropriate text. I don't want the text to overrun like it is on the iPhone 6 Plus.
There's actually a very easy way to customize the text of a FBSDKLoginButton. Here you go:
var fbButton = FBSDKLoginButton()
var titleText = NSAttributedString(string: "Your new button title")
fbButton.setAttributedTitle(titleText, forState: UIControlState.Normal)
From the Facebook docs:
Localizing Facebook Strings
The SDK installer includes a FacebookSDK.strings file that is a localizable as described in Apple's localization guide. You can include the file in your app and localize it like a typical strings file.
You can copy the FacebookSDK.strings file located in the resources directory of the downloaded Facebook sdk and paste it in your project directory. The default string for the key: LoginButton.LogInLong
is Log in with Facebook
, you can change the string to whatever you like.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With