My xml looks like this
<com.facebook.login.widget.LoginButton xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/fb_login_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:paddingLeft="15dp" android:paddingRight="15dp" android:text="CONNECT WITH FACEBOOK" android:textColor="@color/white" android:textSize="20sp" android:textStyle="bold" android:background="@drawable/button_fb_login"/>
and background drawble xml is
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"> <shape> <solid android:color="#4e69a2" /> <stroke android:width="3dip" android:color="#4e69a2" /> <padding android:bottom="0dip" android:left="0dip" android:right="0dip" android:top="0dip" /> </shape> </item> <item> <shape> <solid android:color="#3b5998" /> <stroke android:width="3dip" android:color="#3b5998" /> <padding android:bottom="0dip" android:left="0dip" android:right="0dip" android:top="0dip" /> </shape> </item>
Now in android studio preview screen it shows as expected.
But when I run it on my phone or emulator, it shows "LOG IN WITH FACEBOOK" by default, like this
How do I get my custom text on running the application?
Just need change the attribute accordingly. Refer to : this
eg:
<com.facebook.login.widget.LoginButton xmlns:facebook="http://schemas.android.com/apk/res-auto" facebook:com_facebook_login_text="LOGIN"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With