Dashboard in a horizontal window

You must Login before you can answer or comment on any questions.

I'm trying to create a dashboard initially set to landscape mode with the code pasted on the bottom of this post. The created window (which contains the dashboard) has proper layout but the dashboard icons are spanning across ~2/3 width of the screen (line in portrait mode) an i can drag them up and down. I'm kond of pulling my hair out since i haven't found any options of forcing the dashboard layout. I'm working on iphone with the Titanium 1.7.2

app.js

Titanium.UI.setBackgroundColor('#000');
Titanium.UI.orientation = Titanium.UI.LANDSCAPE_LEFT;
 
Ti.include( './views/window-dashboard.js' );
 
var tabGroup = Titanium.UI.createTabGroup({id:'tabGroup1'});
var tabDashboard = Titanium.UI.createTab({
    id: 'tab-dashboard',
    titleid: 'window-dashboard-title-id',
    window: WindowDashboard.win,
});
./views/window-dashboard.js
var WindowDashboard = {
    win: null,
    init: function(){
        var dashboard = Ti.UI.createDashboardView({
            title: 'Dashboard',
            data: HelperDataElements.getDashboardItemsForGroups(),  
        })
        dashboard.addEventListener('click',function(e){
            var image = Data.getFirstImageForGroup( e.item.id );
        });
        // etc .......      
    }
}
WindowDashboard.init();

— asked 2 years ago by P B
0 Comments

2 Answers

It's maintaining the width/height ratio of a portrait view though the device is rotated to landscape. Everything elese gets updated to reflect the orientation change but the dashboard stays with the wrong dimmensions. What is possibly wrong? The window containing the dashboard is locking the orientationchange event from getting to the dashboard?

The only way to fix this was to set width and height to constant values. I was lucky that i could since my application has to work only in landscape mode. I don't feel good about the way I had to do it though

Your Answer

Think you can help? Login to answer this question!