问题描述
我使用此方法执行Facebook登录,而不使用fb按钮
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活动显示为半透明,但显示一个进度条。幸运的是,我们可以在主题中禁用这个进度条。所以Facebook活动被宣布为
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" />
Voila!登录前的ProgressBar不见了。
Voila! The ProgressBar before login is gone.
这篇关于Android:如何在Facebook登录时隐藏进度圈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!