简体   繁体   中英

Copy font style of ASAuthorizationAppleIDButton in Swift

ASAuthorizationAppleIDButton gives a nice looking button by default. And I would like to copy its font style and size for other UIButton. How can I retrieve the font style and size from a ASAuthorizationAppleIDButton after it is set?

I imagine there is a way similar to something like the below

fileprivate let appleButton = ASAuthorizationAppleIDButton()
fileprivate let fbButton = UIButton()

// set appleButton constraint etc etc…
// then,

fbButton.titleLabel.font = appleButton. sth sth…

在此处输入图像描述

Both Facebook and Google provide their own buttons.

I doubt they want to look like Apple

Also, if you don't use the standard buttons it might make your app look sketchy.

FBLoginButton

https://developers.facebook.com/docs/facebook-login/ios

GIDSignInButton

https://developers.google.com/identity/sign-in/ios/

I ended up making a custom button class with an imageView and lable

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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