Hi, I'm trying to build a nice way to respond to orientation changes. Here is what I implemented:
Alloy.Globals.isPortrait = true; Alloy.Globals.isLandscape = false; Ti.Gesture.addEventListener('orientationchange', function(e) { // here you react to the startup orientation if (e.orientation === Ti.UI.LANDSCAPE_LEFT || e.orientation === Ti.UI.LANDSCAPE_RIGHT){ Alloy.Globals.isPortrait = false; Alloy.Globals.isLandscape = true; }else{ Alloy.Globals.isPortrait = true; Alloy.Globals.isLandscape = false; } Ti.API.info("[ORIENTATION] Change, Portrait="+Alloy.Globals.isPortrait+" Landscape="+Alloy.Globals.isLandscape); });TSS:
"#header":{ height:"10%", layout:"horizontal", backgroundColor: Alloy.Globals.BaseColor } "#header[if=Alloy.Globals.isLandscape]":{ height:"30%", layout:"horizontal", backgroundColor: Alloy.Globals.BaseColor }This works for any screen painted after the gesture change, but I can't seem to get the current screen to re-apply the TSS. Any tips?