Easing out Default.png follow-up
On another thread, I was asking how to ease in or out the default launch screen. After getting a partial answer, I am still facing with an issue. The second Default.png file gets slightly re-sized (due to the statusbar I believe).
The code for the app.js is:
Titanium.UI.setBackgroundColor('#000');
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Tab 1',
window:win1
});
var label1 = Titanium.UI.createLabel({
color:'#999',
text:'I am Window 1',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
win1.add(label1);
//
// create controls tab and root window
//
var win2 = Titanium.UI.createWindow({
title:'Tab 2',
backgroundColor:'#fff'
});
var tab2 = Titanium.UI.createTab({
icon:'KS_nav_ui.png',
title:'Tab 2',
window:win2
});
var label2 = Titanium.UI.createLabel({
color:'#999',
text:'I am Window 2',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
win2.add(label2);
//
// add tabs
//
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
tabGroup.setActiveTab(1);
// open tab group with a transition animation
tabGroup.opacity = 0;
var startupView =Titanium.UI.createImageView({url:'Default.png'});
var startupAnimation = Titanium.UI.createAnimation({
curve:Ti.UI.ANIMATION_CURVE_EASE_IN,
opacity:1,
duration:2000
});
var startupWindow = Titanium.UI.createWindow({
backgroundColor:'#fff'
});
startupWindow.add(startupView);
startupWindow.open();
tabGroup.open(startupAnimation);
3 Answers
-
OK, found the solution. I had to use the top attribute on the imageView and substract the height of the status bar.
var startupView =Titanium.UI.createImageView({url:'Default.png',top:-20.0});
-
thanx, for the information about how this can be achieved
you can also set the statusbar-hidden tag in the tiapp.xml to true i think, so you do not have to calculate the views height
-
In my particular case, I wanted to have the status bar, though the extra computation. Thanks for the tiapp.xml though. Are all features of this file described in the API documentation?