我的应用使用 phonegap 构建。我使用 facebook connect 来登录应用程序。我为按钮创建了两种 css 样式:一种是普通样式,另一种是按下按钮后显示的按下外观。
在浏览器和 IOS 中一切正常,但在 Android 中,用户单击登录按钮后屏幕卡住,直到 Facebook 登录功能启动(并且按钮图标未更改)。 我不知道如何解决这个问题(当删除 Facebook 登录功能时,css 效果有效)。
代码如下:
loginP: function()
{
//Switch the css style to the pressed icon with the relevant pnd icon as the background
var buttonFB=document.getElementById("login_button");
buttonFB.style.background = 'url("../app/images/login/FacebookButtonTightPressed.png")';
buttonFB.style.backgroundRepeat = "no-repeat";
buttonFB.style.backgroundSize = "contain";
//Start Facebook login
Facebook.ConnectFromButton(function(data)
{
LoginPage.afterLogin(data);
});
}
最佳答案
插件呢?如果您没有设置 phongap-version,您将默认为 leading edge,您将需要该插件,并且您还会遇到随机的 transient 错误。 config.xml
中的这一行 <preference name="phonegap-version" value="3.5.0" />
关于javascript - 原生 Android Facebook 登录的按下按钮效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31750778/