How can I hide title bar of Window in Android?
Hi friends,
Could you please give me some suggestions of how to hide the title bar of Window in Android by NOT setting the property fullscreen to True? So that I could set the top of that window. Thanks.
8 Answers
-
navBarHidden : true hides the title. But if you put that window into a tab group it is ignored.
-
Edit tiapp.xml and find tag navbar-hidden and set its content to "true". I will move away a lot of headache.
-
After Titanium SDK 3.3.0, the answer now is either the code below, or by adding an Android theme.
win1.addEventListener('open', function(e) { win1.activity.actionBar.hide(); }); win1.open();
Both explained in the Android Action Bar Guide that is also linked here.
-
This is for Alloy:
2) Put this in app.tss
"Window": { navBarHidden: true }
that's it!
-
Title bar is controlled by navBarHidden : true/false. You question is unclear on what you're trying to accomplish.
-
I still could not hide the title bar by setting navBarHidden to false.
Here is my code:
var win = Titanium.UI.createWindow({ backgroundColor: "#000", top: 100, navBarHidden: false, fullscreen: false }); var data = [{title:"Row 1"},{title:"Row 2"}]; var table = Titanium.UI.createTableView({data:data}); win.add(table); win.open();
After running this code the top property is not taking effect, and the title bar still appears. What I want to be done is to hide the title bar, and set the top of the window to 100.
Actually the main purpose I want to make this window to be a heavyweight window and put it in the tab. So I have to set property fullscreen, modal, or tabBarHidden. If I didn't set value to those properties, the app will exit when I press on Back button. That's why I want to hide the title bar, and set property fullscreen to false.
Thank you
-
when your're opening a window try to use the property fullscreen:true, and you'll see the title in the screen.
here is my snippet:var win1 = Ti.UI.createWindow({ backgroundColor: '#FFF', title:'Just Messing around', //navBarHidden:true }); win1.open({fullscreen:true});
hope to be useful see ya!
jimmy -
In latest Version of titanium any of the solution will not work perfectly..
For every window The below solution is correct posted by "Gazihan Alankus"win1.addEventListener('open', function(e) { win1.activity.actionBar.hide(); }); win1.open();
But to hide every title bar from every window you have to do some extra work.
First Create Folder "values" in res directory in titanium, then create a file themes.xml (any valid name will work)
then write the following code<?xml version="1.0" encoding="utf-8"?> <resources> <style name="Theme.NoActionBar" parent="@style/Theme.AppCompat"> <item name="android:windowActionBar">false</item> <item name="android:windowNoTitle">true</item> </style> </resources>
and finally in tiapp.xml write the following code..
<manifest> <application android:theme="@style/Theme.NoActionBar"/> </manifest>
I think this will work..