Remove Android App Title Bar

I understand that these properties in the manifest:

android:theme="@android:style/Theme.NoTitleBar"     
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

can remove the title bar. However, I constantly check the Graphical Layout when I am modifying my app. When I look at the Graphical Layout I still see the title bar. I want to remove the title bar in a way that I don't have to see it during the development of the game.


Solution 1:

Simple way is to put this in your onCreate():

// Java
getSupportActionBar().hide();
// Kotlin
supportActionBar?.hide()

Solution 2:

  1. In the Design Tab, click on the AppTheme Button

  2. Choose the option "AppCompat.Light.NoActionBar"

  3. Click OK.

Row of icons at the top of design view of a layout .xml in Android Studio, The dropdown box with the contrast icon will change the theme.

Solution 3:

for Title Bar

requestWindowFeature(Window.FEATURE_NO_TITLE);

for fullscreen

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);

Place this after

super.onCreate(savedInstanceState);

but before

setContentView(R.layout.xml);

This worked for me.try this

Solution 4:

I was able to do this for Android 2.1 devices and above using an App Compatibility library theme applied to the app element in the manifest:

<application
    ...
    android:theme="@style/AppTheme" />

<style name="AppTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
    ...
   <item name="windowNoTitle">true</item>
   <item name="android:windowNoTitle">true</item>
</style>

Note: You will need to include the com.android.support:appcompat-v7library in your build.gradle file