Google Plus登录按钮框架类型kGPPSignInButtonStyleWide无效

时间:2016-10-12 07:05:32

标签: ios objective-c iphone

我能够正确登录但无法更改按钮大小,这是我的代码。如何更改GPPSignInButton的高度和宽度?

GPPSignInButton *signInButton11 = [[GPPSignInButton alloc] init];
[signInButton11 setTranslatesAutoresizingMaskIntoConstraints:NO];
[signInButton11 setStyle:kGPPSignInButtonStyleWide];
[signInButton11 setColorScheme:kGPPSignInButtonColorSchemeDark];
[signInButton11 setImage:[UIImage imageNamed:@"g_plus_icone.png"] forState:UIControlStateNormal]; //  custom image

CGRect frame = signInButton11.frame;
frame.origin.x =signInButton.frame.origin.x+signInButton.frame.size.width+10;
frame.origin.y = signInButton.frame.origin.y;
signInButton11.frame = frame;

[self.view addSubview:signInButton11];
GPPSignIn *signIn = [GPPSignIn sharedInstance];
signIn.shouldFetchGooglePlusUser = YES;
signIn.shouldFetchGoogleUserEmail = YES;

signIn.clientID = kClientId;
signIn.scopes = @[@"profile"];
signIn.delegate = self;

0 个答案:

没有答案