因为如果用户不想登录,那么就没有办法回到以前的屏幕,用户必须杀死该应用程序。我怎样才能把导航栏在谷歌登录屏幕?
2
A
回答
3
确保您UIWebView
是具有UINavigationController
视图控制器内。我怀疑你是以模态方式呈现登录屏幕(通过故事板或以编程方式) - 尝试将其推到导航堆栈上。
编辑:这是我的意思的代码,在QEFilesListViewController
:
GTMOAuth2ViewControllerTouch *authViewController =
[[GTMOAuth2ViewControllerTouch alloc] initWithScope:kGTLAuthScopeDriveFile
clientID:kClientId
clientSecret:kClientSecret
keychainItemName:kKeychainItemName
delegate:self
finishedSelector:finishedSelector];
[self presentViewController:authViewController
animated:YES
completion:nil];
如果你改变了最后陈述
[self.navigationController pushViewController:authViewController animated:YES];
你会得到一个返回按钮:
我知道当你按下后退按钮时,它会再次自动显示登录画面。我想如果你想在你自己的应用中实现这一点,你可以采取适当的措施,以确保不会发生。
2
试试波纹管代码。这个补丁解决了我的问题。
GTMOAuth2ViewControllerTouch *authViewController = [GTMOAuth2ViewControllerTouch controllerWithScope:kGTLAuthScopeDrive
clientID:GoogleDriveClientID
clientSecret:GoogleDriveClientSecret
keychainItemName:GoogleDriveKeychainItemName
completionHandler:authCompletionHandler];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:authViewController];
navigationController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[rootController presentViewController:navigationController animated:YES completion:nil];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Cancel", nil)
style:UIBarButtonItemStylePlain
target:self
action:@selector(didCanceledAuthorization)];
authViewController.navigationItem.rightBarButtonItem = nil;
authViewController.navigationItem.leftBarButtonItem = cancelButton;
authViewController.navigationItem.title = @"Google Drive";
});
相关问题
- 1. 我怎样才能把这个导航栏呢?
- 2. 我怎样才能让谷歌的OAuth自动登录
- 3. 我们怎样才能把图像放在android屏幕的标题栏中?
- 4. 我怎样才能得到屏幕-Android
- 5. Android:我怎样才能把TextView放到java屏幕的底部
- 6. 我我怎样才能AJAX导航
- 7. 我怎样才能让我的JS导航栏
- 8. 我怎样才能把导航项目的title属性
- 9. 我怎样才能让自定义导航栏透明的RNRF
- 10. 谷歌饼图:我怎样才能把提示在我中心DIV
- 11. 我怎样才能一次导入所有的谷歌字体?
- 12. 我怎样才能把插在VAR
- 13. 我怎样才能把一个标签与时间对我的屏幕
- 14. 谷歌+登录按钮autorization屏幕
- 15. 我怎样才能把GridView的行
- 16. 我怎样才能把它变成shellcode?
- 17. 我怎样才能把“子类”一类
- 18. 我怎样才能把整个像素与pygame屏幕上的数组?
- 19. 登录屏幕和导航控制器
- 20. 在Ghostscript中我怎样才能暂停输出到屏幕
- 21. 我怎样才能在屏幕上显示日历
- 22. 我怎样才能让我的网格脱离屏幕?
- 23. 我怎样才能加载谷歌地图在iphone
- 24. 我怎样才能打开下mynavbar第二行,如果在导航栏
- 25. 怎样命名导航栏
- 26. 我怎样才能显示我的位置谷歌地图android
- 27. 我怎样才能航线的用symfony
- 28. 我怎样才能导入System.Windows在C#
- 29. 我怎样才能让侧边栏
- 30. 我怎样才能使布局小于3“屏幕和布局4.8”屏幕(android)
我们只是使用Google SDK。不在UIWebView中显示。 参考网址:https://github.com/googledrive/ios-quickeditor –