0
我已將Facebook登錄按鈕添加到我的應用程序,但是當我無法將其從左上角移動到屏幕中心時。 我想:無法更改FBSDKLoginButton位置
loginButton.center = (self.view?.center)!
和
loginButton.frame = CGRect(origin: CGPoint(x: self.frame.midX,y :self.frame.midY), size: CGSize(width: loginButton.frame.width, height: loginButton.frame.height))
但既不工作,中心變量的變化,但按鈕依然在左上角
有誰知道如何解決這一問題?
我這個代碼
let loginButton: FBSDKLoginButton = {
let button = FBSDKLoginButton()
button.readPermissions = ["email"]
button.translatesAutoresizingMaskIntoConstraints = false
return button
}()
view.addSubview(loginButton)
你如何添加按鈕來查看?請分享您用來添加按鈕的代碼行。 – DevKyle
讓loginButton:FBSDKLoginButton = { 令按鈕= FBSDKLoginButton() button.readPermissions = [ 「電子郵件」] button.translatesAutoresizingMaskIntoConstraints =假 返回按鈕 }() view.addSubview(loginButton) – toiavalle