2016-12-15 6 views
0

この質問をするのは面白いです。私は私の迅速なプロジェクトのためにデフォルトGoogleSignを使用しています。高さの値の変更はボタンの高さを変更しません。 高さの値が59か500かにかかわらず、固定高さを表示します。GoogleSign 'swift 3'でエラーが発生しました

// GoogleSignInボタン

let signInButton = GIDSignInButton(frame: CGRect(x: 400, y: 144, width: 332, height: 59)) 
+0

のようなものをレンダリングする必要があり、それは変更することはできませんはい、あなたは '.styleを使用する必要があります'プロパティ。 – PiyushRathi

答えて

0

あなたのGoogleSignInボタンにカスタムサイズを与えることはできません。ボタンにはstyleプロパティを使用して、3種類のサイズしか指定できません。

signInButton.style = .IconOnly 
    signInButton.style = .Standard 
    signInButton.style = .Wide 

感謝:)

0

がボタンにGoogleの歌うの操作が許可されていません。代わりにできるのは2つのうちのどちらかです。 Google Sing Inボタンの上に自分のボタンを表示するか、自分の機能で自分の衣装ボタンを作るだけです。

  //add google sing in button 
    googleBtn.frame = CGRect(x: 16, y: 116 + 66, width: view.frame.width - 32, height: 50) 
    view.addSubview(googleBtn) 

    let customButton = UIButton(type: .system) 
    customButton.frame = CGRect(x: 16, y: 116 + 66 + 66, width: view.frame.width - 32, height: 50) 
    customButton.backgroundColor = .orange 
    customButton.setTitle("Custom Google Sing in ", for: .normal) 
    customButton.setTitleColor(.white, for: .normal) 
    customButton.titleLabel?.font = UIFont.boldSystemFont(ofSize: 14) 
    customButton.addTarget(self, action: #selector(handlecustomgoogleSingin), for: .touchUpInside) 

    view.addSubview(customButton) 

機能

func handlecustomgoogleSingin(){ 

    GIDSignIn.sharedInstance().signIn() 

    } 

これは、この

enter image description here

関連する問題