问题描述
我正在使用这种方法在不使用 fb 按钮的情况下执行 Facebook 登录 无需登录的 Facebook 身份验证按钮
I am using this method to perform a Facebook login without using the fb button Facebook authentication without login button
它工作正常,但在 fb 登录期间显示黑色背景的进度条,我猜来自活动 com.facebook.LoginActivity
It's working fine, but a progress bar with black background is shown during fb login, I guess from activity com.facebook.LoginActivity
如何避免显示该活动?,我只想在登录 com.facebook.LoginActivity 时显示我自己的应用活动进度
How can I avoid displaying that activity?, I just want to show my own progress from my app activity during login in com.facebook.LoginActivity
推荐答案
我在使用 facebook sdk 4.x 时遇到了同样的问题.当我单击 facebook 登录按钮时,Facebook Activity 显示为半透明,但它显示一个进度条.幸运的是,我们可以在主题中禁用此进度条.所以 Facebook Activity 被声明为
I had the same problem with facebook sdk 4.x. When I click the facebook login button the Facebook Activity appears translucent but it shows a progress bar. Luckily we can disable this progress bar in the theme. So the Facebook Activity is declared as
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
我们要做的就是创建一个继承自Theme.Translucent.NoTitleBar
的样式并隐藏进度条:
All we have to do is create a style that inherits from Theme.Translucent.NoTitleBar
and hides the progress bar:
<style name="FullyTranslucent" parent="android:Theme.Translucent.NoTitleBar">
<item name="android:progressBarStyle">@style/InvisibleProgress</item>
</style>
<style name="InvisibleProgress">
<item name="android:visibility">gone</item>
</style>
现在将活动的主题设置为我们的新主题:
Now set the theme of the activity to our new theme:
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name"
android:theme="@style/FullyTranslucent" />
瞧!登录前的 ProgressBar 不见了.
Voila! The ProgressBar before login is gone.
这篇关于Android:如何在 Facebook 登录中隐藏进度圈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!