Hide title bar and notification bar

mkvidyashankar

Active Member
Licensed User
Longtime User
Hi

How to hide Activity title bar and notification bar above that ?
 

alfcen

Well-Known Member
Licensed User
Longtime User
>Can this be done with code??

Nope, not programmatically.
If you have auto-complete engaged you will see that "activity.title.visible" won't pop up.

Perhaps later versions of B4A will be able to manipulate title bar and screen modes.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
This has changed since version 2.5.
You find the two properites on top or the Activity code in the Activity Attributes Region.
Set the two values like below:
B4X:
#Region  Activity Attributes. 
    #FullScreen: True
    #IncludeTitle: False
#End Region
Best regards.
 
Upvote 0

PenguinHero

Member
Licensed User
Longtime User
I have a related question, that I have searched the forums for, but not found if it has already been asked...

I have the following in my app:
B4X:
#FullScreen: True
#IncludeTitle: False

But for a very brief moment when I run the app I can see the title on the little black bar, before it disappears and all is as I expect.

Is there something I can do to prevent it appearing at all? I know its just a cosmetic thing, but I'd like to stop it appearing at all, if possible.

I'm using v2.52 but for an app was was written on the previous major version, should that make a difference.


Thanks,
PH
 
Upvote 0

PenguinHero

Member
Licensed User
Longtime User
Try adding this line to your manifest:
B4X:
SetActivityAttribute(Main, android:theme, @android:style/Theme.Black.NoTitleBar)

Thanks NJDude, that fixed it!

I had assumed that was what the "#IncludeTitle: False" setting in the Module Attributes was doing (or something similar).


PH
 
Upvote 0

CidTek

Active Member
Licensed User
Longtime User
Try adding this line to your manifest:
B4X:
SetActivityAttribute(Main, android:theme, @android:style/Theme.Black.NoTitleBar)

This has worked great for me to prevent the short flash of the title bar showing, but I have now added some views to my splash screen that have the Gingerbread theme whereas on other Activities they theme properly to Jelly Bean. Removing this line fixes the theming problem but I get the short flash of the title bar again.
 
Upvote 0

CidTek

Active Member
Licensed User
Longtime User
Sorry for the bump but it's been over a month since I asked. Anybody have an idea why using the above manifest entry causes all views in that activity to show in Gingerbread style whereas after removing it, all views properly show in jelly Bean style.

I want to both prevent the title flash and avoid a poor UI with Gingerbread views.

Is there a better manifest entry?
 
Upvote 0

CidTek

Active Member
Licensed User
Longtime User
It is always better to start a new thread for a new question. The style you set is an old style.

You can use this one instead: @android:style/Theme.Holo.NoActionBar

Thank you very much - problem solved.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…