Android Studio (0.4.6) hide title bar in preview?

10,001

Solution 1

In the preview window there is a button (for me a symbol of a half filled circle, right next to the rotate screen button) that allows you to select a theme.

Go to All > NoTitleBar.FullScreen for a complete full-screen preview.

Solution 2

Just wanted to add that in order for this to work in Android Studio's preview you have to make sure the Theme selected in XML is the same as the one selected in the little half filled circle: enter image description here

Share:
10,001
Admin
Author by

Admin

Updated on June 08, 2022

Comments

  • Admin
    Admin about 2 years

    Does anyone know of a way to hide the title bar in Android Studio previews (that's the title bar on the device previews, not the title bar of Android Studio)? I am writing a full screen app and using virtually all the screen but the preview insists on showing the title bar which makes it very difficult to scale things correctly. Any ideas?

    I have included my theme to show I am actually asking for the title to be hidden, JIC I have done something wrong, like I normally do ;)

    <style name="AppTheme" parent="android:Theme.Holo.Light">
        <item name="android:windowFullscreen">true</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:buttonStyle">@style/defaultButtonStyle</item>
        <item name="android:textSize">@dimen/fontSize</item>
    </style>
    

    Thanks in advance, as always.

    PS: How do you do strikethrough / bold etc in code blocks? I don;t seem to be able to get it to work...

  • clocksmith
    clocksmith over 9 years
    Thanks. I had my preview window very small and this button was hidden with no indication that exists. Make sure you're preview window is large enough!