Wednesday, April 17, 2013

[android help] Change the Facebook SDK 3.0 Loggin Button Image


Do I understand rightly that you'ved added Facebook's own custom FacebookLoginButton view?


If that's the case, then the constructor FacebookLoginButton(final Context context, final AttributeSet attrs) will be called by the layout inflator, which references the R file of the facebook library- no good.


So if you want to customize that button beyond what is exposed in the facebook sdk, I've had success with copying the view class - FacebookLoginButton.java - into my own project (you may need to tinker with FacebookLoginButton.java to make sure everything references back to the facebook library correctly). Along with it, copy all of the resources referenced by that constructor into your own project. It goes without saying, you'll now need to make sure everything in the copied class references your projects resources now.


Finally, you'll of course need to change the button class in your layout file to the fully qualified class name to that copied FacebookLoginButton in your own project.


Hope this helps.



.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...