问题
I am using facebook to login in my app and i want to change default text of facebook login button.how can i do that,
<com.facebook.login.widget.LoginButton
android:id="@+id/authButton"
android:text="facebbok"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:paddingBottom="12dp"
android:paddingTop="12dp" />
Thank you.
回答1:
Add to your strings.xml:
<string name="com_facebook_loginview_log_out_button">Custom Log out</string>
<string name="com_facebook_loginview_log_in_button">Custom Log</string>
<string name="com_facebook_loginview_log_in_button_long">Custom Log in</string>
回答2:
Use Facebook namespace
<com.facebook.login.widget.LoginButton
android:id="@+id/signup_signupFacebookButton"
android:layout_width="fill_parent"
xmlns:facebook="http://schemas.android.com/apk/res-auto"
facebook:com_facebook_login_text="Sign up with Facebook"
</com.facebook.login.widget.LoginButton>
来源:https://stackoverflow.com/questions/33176287/how-to-change-text-of-facebook-button-in-facebook-sdk-4-7-0-android