[英]How to hide Android ActionBar during Facebook Login?
I have a regular workflow. 我有固定的工作流程。 It all starts with login page, with a "Login with Facebook" button.
这一切都从登录页面开始,带有“使用Facebook登录”按钮。 If user press this button this this button a Facebook Login page appear.
如果用户按下此按钮,此按钮将显示Facebook登录页面。 In case of success the app home screen appear.
如果成功,则出现应用程序主屏幕。
I want ActionBar to appear after successful login. 我希望ActionBar在成功登录后出现。 So no ActionBar during startup, no ActionBar on login page, no ActionBar behind Facebook login form.
因此,启动过程中没有ActionBar,登录页面上没有ActionBar,Facebook登录表单后面没有ActionBar。
I can hide ActionBar on login page from Manifest: 我可以从清单中隐藏登录页面上的ActionBar:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name="hu.go.abs_style_test.LoginActivity"
android:theme="@style/Theme.Sherlock.NoActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="hu.go.abs_style_test.MainActivity" />
But I can't hide it behind Facebook login form: 但我无法将其隐藏在Facebook登录表单的后面:
I want to use ActionBar after login page, so this isn't possible, since ActionBar will be null after: 我想在登录页面后使用ActionBar,所以这是不可能的,因为在以下情况下ActionBar将为null:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
Oh, and one more thing: I'm using ActionBarSherlock
. 哦,还有一件事:我正在使用
ActionBarSherlock
。
I suggest you hide you ActionBar programmatically (and not in XML files) using getSupportActionBar().hide();
我建议您使用
getSupportActionBar().hide();
以编程方式(而不是在XML文件中)隐藏ActionBar getSupportActionBar().hide();
while you are displaying the Facebook login popup, then call getSupportActionBar().show();
在显示Facebook登录弹出窗口时,请调用
getSupportActionBar().show();
when the focus goes back to you application. 当焦点回到您的应用程序上时。
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
android:label="@string/app_name" />
solved my issue. 解决了我的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.