我试图在 SplashScreenActivity 中隐藏 ActionBar,但我无法隐藏。它总是显示。
我试过了:但没用
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_splash);
或
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
getActionBar().hide();
setContentView(R.layout.activity_splash);
或
这不幸地停止了应用
<application
android:name="info.androidhive.awesomewallpapers.app.AppController"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/FreeWallTheme">
<activity
android:name="info.androidhive.awesomewallpapers.SplashActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
最佳答案
在您应用程序的 list 文件中,在 <application>
中设置以下属性标签。
android:theme="@android:style/Theme.NoTitleBar.Fullscreen
关于android - 无法隐藏 ActionBar (Android),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27919167/