我们正在使用最新的 Facebook iOS SDK (3.5),并且在 webview 登录时遇到以下问题。当前目标选项卡 Conceal 了 facebook 确定和取消按钮,因此用户无法授权该应用。
重现步骤:
1) 使用 Facebook SDK UIWebView 登录 2) 出现“您已经授权...”的文字 3) Conceal 按钮和取消按钮, View 不可滚动。
这个问题有解决办法吗?
------------更新------------
该问题现已由 Facebook 修复。
最佳答案
我不确定这是否对 IOS 用户有帮助,但我可以告诉您我是如何在 Android 中为我的应用程序修复此问题的,以防其他人遇到此错误(也许有人可以将此修复程序转化为 IOS)。
在 FaceBookSDK 中,我修改了 com/facebook/widget/WebDialog.java,这样一旦加载了网络对话框,它就会查找“当前目标” block 并将其 Conceal (如果存在)。
在 com/facebook/widget/WebDialog.java 中:
private class DialogWebViewClient extends WebViewClient {
// ... other methods ...
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
if (!isDetached) {
spinner.dismiss();
}
/*
* Once web view is fully loaded, set the contentFrameLayout background to be transparent
* and make visible the 'x' image.
*/
contentFrameLayout.setBackgroundColor(Color.TRANSPARENT);
webView.setVisibility(View.VISIBLE);
crossImageView.setVisibility(View.VISIBLE);
// I don't know how to highlight in the code block
// So I just add this extra long comment to make it obvious
// Add a javascript call to hide that element, if it exists
webView.loadUrl("javascript:try{ document.getElementById('nux-missions-bar').style.display='none'; } catch (e) {}");
// End changes
}
关于ios - 当前目标在 web View 中的 Facebook 授权期间 Conceal facebook ok 按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16661144/