Cannot change the height of Login Button in FBSDKLoginKit?

后端 未结 12 1639
刺人心
刺人心 2021-02-05 09:19

I am using FBSDKLoginKit in iOS with Swift.

Up until recently it has been working perfectly, however I now cannot override the height of my button in the St

12条回答
  •  粉色の甜心
    2021-02-05 09:50

    As for now the Facebook button has only one constraint which is the height constraint and you can just remove all constraints of the button and add yours.

    facebookSignInButton.removeConstraints(facebookSignInButton.constraints)
    

    But of course this can change in the future and you might remove a constraint that you don't want to. Maybe a better solution would be if you remove only that problematic constraint.

    if let facebookButtonHeightConstraint = facebookSignInButton.constraints.first(where: { $0.firstAttribute == .height }) {
        facebookSignInButton.removeConstraint(facebookButtonHeightConstraint)
    }
    

提交回复
热议问题