我正在尝试更改Android上的facebook登录按钮上的文字。
我已经完成了一些stackoverflow的答案,但没有一个工作。有没有办法改变它?
如果我使用com.facebook.login.widget.LoginButton
按钮,则无法更改按钮上的文字。 (我可以登录)
<com.facebook.login.widget.LoginButton
android:id="@+id/fragment_login_fb_login_button"
android:layout_width="@dimen/fragment_login_fb_button_width"
android:layout_height="@dimen/fragment_login_fb_button_height"
android:layout_gravity="center"
android:layout_marginTop="@dimen/fragment_login_fb_button_top_margin"
android:background="@drawable/fragment_login_fb_login_button_background"
android:drawableLeft="@drawable/facebook_icon"
android:gravity="center"
android:text="@string/label_fragment_login_sign_in_with_facebook"
android:textColor="@android:color/white"
android:textStyle="bold"/>
如果我使用Button
我可以更改文字,但我无法登录。
<Button
android:id="@+id/fragment_login_fb_login_button"
android:layout_width="@dimen/fragment_login_fb_button_width"
android:layout_height="@dimen/fragment_login_fb_button_height"
android:layout_gravity="center"
android:layout_marginTop="@dimen/fragment_login_fb_button_top_margin"
android:background="@drawable/fragment_login_fb_login_button_background"
android:drawableLeft="@drawable/facebook_icon"
android:gravity="center"
android:text="@string/label_fragment_login_sign_in_with_facebook"
android:textColor="@android:color/white"
android:textStyle="bold"/>
我正在使用android facebook sdk version 4.5.0
答案 0 :(得分:0)
答案 1 :(得分:0)
<RelativeLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp">
<com.facebook.login.widget.LoginButton
xmlns:facebook="http://schemas.android.com/apk/res-auto"
android:id="@+id/login_button"
android:layout_width="300dp"
android:layout_height="100dp"
android:paddingTop="15dp"
android:paddingBottom="15dp" />
<LinearLayout
android:id="@+id/llfbSignup"
android:layout_width="300dp"
android:layout_height="50dp"
android:background="@drawable/facebook"
android:layout_gravity="center_horizontal"
android:orientation="horizontal">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/facbk"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/fullGray"
android:layout_marginLeft="10dp"/>
<com.yadav.bookedup.fonts.GoutamBold
android:layout_width="240dp"
android:layout_height="50dp"
android:text="Sign Up via Facebook"
android:gravity="center"
android:textColor="@color/white"
android:textSize="18dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"/>
</LinearLayout>
</RelativeLayout>
答案 2 :(得分:0)
在未预览的设备上运行
<com.facebook.login.widget.LoginButton
android:layout_height="wrap_content"
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"/>