How to change text of facebook button in Facebook sdk 4.7.0 android

点点圈 提交于 2019-12-12 03:24:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!