IOS Login Button for IOS

Is there a way to get the Facebook login button to display “Sign in” rather than “Sign in to Facebook”? The following shows how it looks on the iPhone 6

enter image description here

And lower on the iPhone 6 Plus

enter image description here

I briefly reviewed the Facebook SDK on Github and couldn't find a solution. Facebook basically looks at the width of the button and then displays the corresponding text. I don’t want the text to overflow like on the iPhone 6 Plus.

+4
source share
2 answers

Actually a very simple way to customize the text of FBSDKLoginButton. Here you are:

var fbButton = FBSDKLoginButton()
var titleText = NSAttributedString(string: "Your new button title")
fbButton.setAttributedTitle(titleText, forState: UIControlState.Normal)
+8
source

In Facebook docs:

Facebook string localization

SDK FacebookSDK.strings, , Apple. .

FacebookSDK.strings, Facebook sdk, . : LoginButton.LogInLong - Log in with Facebook, , .

+2

Source: https://habr.com/ru/post/1598339/


All Articles