gpt4 book ai didi

Android - 如何更改 Facebook 登录按钮上的文本

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:16:07 27 4
gpt4 key购买 nike

我正在尝试更改 Android 上 Facebook 登录按钮上的文本。

我浏览了很多 Stack Overflow 的答案,但没有一个有效。有办法改变吗?

我尝试了这些链接中的答案:[1][1]、[2][2]、[3][3]。

如果我使用 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 版本 4.5.0[1]: customize Android Facebook Login button[2]: Is it possible to change Facebook login button image in Facebook Android SDK3?[3]:Set Login/Logout Text for Button in Facebook Android SDK 4.0?

最佳答案

你可以尝试使用facebook命名空间并为其设置com_facebook_login_text属性

<com.facebook.login.widget.LoginButton
xmlns:facebook="http://schemas.android.com/apk/res-auto"
facebook:com_facebook_login_text="YourText"/>

关于Android - 如何更改 Facebook 登录按钮上的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32676501/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com