I have a custom overlay view applied to the camera that I am trying to manipulate when the device is rotated to landscape. I am able to change the styles of the elements inside the view, but the view itself always retains its original dimensions no matter what I do.
// camera.xml <Alloy> <View id="cameraOverlay"> <Label id="recordTime" text="00:00:00" /> <Label id="currentSpeed" /> <Label id="averageSpeed" /> <View id="recordButton" onClick="toggleRecord" /> <Button class="videosButton" onClick="openVideos" title="Videos" /> <Module id="mapView" module="ti.map" method="createView" /> </View> <Window id="cameraWin"> <Button class="videosButton" onClick="openVideos" title="Videos" /> </Window> </Alloy>
// camera.js var matrix = Ti.UI.create2DMatrix(); var animation = Titanium.UI.createAnimation({ transform: matrix, duration: 200 }); Ti.Gesture.addEventListener('orientationchange', function(e) { var height, width; switch(e.orientation) { case Ti.UI.PORTRAIT: matrix = Ti.UI.create2DMatrix({ rotate: 0 }); $.mapView.width = Ti.UI.FILL; $.mapView.height = 160; height = Ti.Platform.displayCaps.platformHeight; width = Ti.Platform.displayCaps.platformWidth; break; case Ti.UI.LANDSCAPE_LEFT: matrix = Ti.UI.create2DMatrix({ rotate: -90 }); $.mapView.width = 160; $.mapView.height = Ti.UI.FILL; height = Ti.Platform.displayCaps.platformWidth; width = Ti.Platform.displayCaps.platformHeight; break; case Ti.UI.LANDSCAPE_RIGHT: matrix = Ti.UI.create2DMatrix({ rotate: 90 }); $.mapView.width = 160; $.mapView.height = Ti.UI.FILL; height = Ti.Platform.displayCaps.platformWidth; width = Ti.Platform.displayCaps.platformHeight; break; } animation.transform = matrix; $.cameraOverlay.height = height; $.cameraOverlay.width = width; $.cameraOverlay.animate(animation); });I've tried many combinations of applying the dimensions to the overlay and the animation itself, but I can't figure it out.
Ant help would be appreciated.