简体   繁体   中英

Pressed button effect for Native Android Facebook login

My app uses phonegap build. I use facebook connect in order to log in to the app. I created two css styles for the button: normal one, and one with pressed look to be displayed after the button is pressed.

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). I have no idea how to solve this (when removing the Facebook Login function, the css effect works).

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. This line in your config.xml

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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