'How to hide title bar from my current window titanium Android
I want to hide title bar from my current window. I have searched for "hideNavBar:true" but still it is not working, so please help me in hiding the title bar from Android app. My code is below.
My create.js is:
var curWin = Ti.UI.currentWindow;
var imgarr = [{
leftImage: 'images/previous.png',
title: "Create Your Popmount",
hasChild: true,
path: 'Take_Photo.js',
navBarHidden: true
}, {
leftImage: 'images/previous.png',
title: "Get Information",
hasChild: true,
path: 'Take_Photo.js',
navBarHidden: true
}, {
leftImage: 'images/previous.png',
title: "Go to Website",
hasChild: true,
path: 'Take_Photo.js',
navBarHidden: 'true'
}];
//creating table
and photo.js is:
var win = Titanium.UI.currentWindow;
var imageView = Titanium.UI.createImageView({
height: 200,
width: 200,
top: 20,
left: 10,
backgroundColor: '#999'
});
win.add(imageView);
But from takephoto.js I am not able to hide navbar/title bar as in Android. I also write true in my Tiapp.xml for nav bar, but it works for only first screen.
Solution 1:[1]
In your photo.js file try to add this:
var win = Titanium.UI.currentWindow;
win.hideNavBar();
Solution 2:[2]
You need to set the parameter when you create the window:
var win = Ti.UI.createWindow({
title:'My Window',
backgroundColor:'#fff',
navBarHidden:true
});
Setting win.navBarHidden = true; after the window is created will not work.
Solution 3:[3]
Try this:
var win = Ti.UI.createWindow({
title:'My Window',
backgroundColor:'#fff',
titleControl: false
});
Solution 4:[4]
Actually if we do not hide the titlebar in app.js it moves through out the app as enabled so need to disable in app.js and then it will not create problem in rest of the screens hope this will help you!.
Solution 5:[5]
Change Your Photo.js file like this
var win = Titanium.UI.currentWindow;
var imageView = Titanium.UI.createImageView({
height: 200,
width: 200,
top: 20,
left: 10,
navBarHidden: true,
backgroundColor: '#999',
});
win.add(imageView);
This will work
Solution 6:[6]
All answers are outdated now. From Titanium 3.3.0 and above, this method works for Android.
win1.addEventListener('open', function(e) {
win1.activity.actionBar.hide();
});
win1.open();
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Zoltan Toth |
| Solution 2 | Jeff Bonnes |
| Solution 3 | Yannick Blondeau |
| Solution 4 | Ali |
| Solution 5 | Yahya Uddin |
| Solution 6 | Jibran Khan |
