gpt4 book ai didi

ios - 通过presentViewController:animated:completion呈现GTMOAuth2ViewControllerTouch

转载 作者:行者123 更新时间:2023-12-01 19:01:31 25 4
gpt4 key购买 nike

我需要从现有的viewController中以模态形式打开google登录viewController。没关系,但是我不知道如何添加按钮以关闭模式,因为我没有使用UINavigationController。有人遇到同样的问题吗?

GTMOAuth2ViewControllerTouch *viewController;
viewController = [GTMOAuth2ViewControllerTouch controllerWithScope:GOOGLE_SCOPE_YOUTUBE
clientID:GOOGLE_CLIENT_ID
clientSecret:GOOGLE_CLIENT_SECRET
keychainItemName:GOOGLE_KEYCHAIN
delegate:self
finishedSelector:finishedSel];

NSDictionary *params = [NSDictionary dictionaryWithObject:@"es" forKey:@"hl"];
viewController.signIn.additionalAuthorizationParameters = params;
viewController.signIn.shouldFetchGoogleUserProfile = YES;
NSString *html = @"<html><body style=\"font-family:Arial\"><div style=\"text-align:center;\">Cargando página para iniciar sesión...</div></body></html>";
viewController.initialHTMLString = html;
[self presentViewController:viewController animated:NO completion:nil];

谢谢

最佳答案

我有同样的问题,最终使用

[UIView  beginAnimations:nil context:NULL];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:0.75];
[self.navigationController pushViewController:detailView animated:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.navigationController.view cache:NO];
[UIView commitAnimations];

但这并不是完美的解决方案(顺便说一句,而且很丑)。我想知道为什么导航栏不出现
[self presentViewController:viewController animated:NO completion:nil];

是的,我们可以手动添加导航栏
UINavigationBar *navBar=[etc…

我认为完美的解决方案是使用新的UIViewTransitions(Apple想要强迫我们使用它吗?)。

关于ios - 通过presentViewController:animated:completion呈现GTMOAuth2ViewControllerTouch,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22547502/

25 4 0