简体   繁体   English

按下按钮效果可进行本机Android Facebook登录

[英]Pressed button effect for Native Android Facebook login

My app uses phonegap build. 我的应用程序使用phonegap构建。 I use facebook connect in order to log in to the app. 我使用facebook connect来登录该应用程序。 I created two css styles for the button: normal one, and one with pressed look to be displayed after the button is pressed. 我为按钮创建了两种CSS样式:普通样式和一种具有按下外观的样式,将在按下按钮后显示。

In browser and IOS it all works well, but in Android, the screen freezes after the user clicks the login button until the Facebook Login function starts (and the button icon is not changed). 在浏览器和IOS中,一切正常,但是在Android中,用户单击登录按钮后,屏幕冻结,直到Facebook登录功能启动(按钮图标未更改)。 I have no idea how to solve this (when removing the Facebook Login function, the css effect works). 我不知道如何解决此问题(删除Facebook登录功能时,css效果有效)。

Here is the code: 这是代码:

 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); }); } 

What about the plugin? 插件呢? If you did not set the phongap-version , you will default to leading edge and you will NEED the plugin, and you are also subject to random transient bugs. 如果您未设置phongap-version ,则将默认设置为Leading Edge,并且需要该插件,并且还会遇到随机的临时错误。 This line in your config.xml config.xml中的这一行

<preference name="phonegap-version" value="3.5.0" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM