09-26-2013 07:32 PM
I agree with zmey on avoiding layoutUpdateHandler it's not reliable. (+only updates when a size changes)
DisplayInfo doesn't account for layout changes so to counter that when you go from portrait to landscape simply set any height to DisplayInfo.width and any width to DisplayInfo.height & vice versa. I use this a lot haven't had any caveats
To be fair here the docs do say it is asynchronous and that updates will only be triggered when a size change completes so to say it's unreliable for exactly these reasons doesn't make a whole lot of sense.
Each to their own though whatever works best for you.
09-26-2013 07:49 PM - edited 09-26-2013 07:52 PM
I never read the docs on it just skipped to the code part heh. I marked it off as unreliable because it doesnt update when the control is created (even though its going from nothing to something) Not saying it can't be useful either
09-27-2013 03:55 PM
well, seems to be related to rotation of the ImageView. I tried many/most of the solutions above and just couldn't get it to go. so i loaded the default NavigationPane project in momentics and threw in an ImageView and loaded up a picture. size was fine, i.e. filled the avilable area, but rotation was off by 90 degrees.
by rotating the ImageView i can get the image oriented correctly, but then it won't fill the available area.
in my "real" app, i'm using the same technique... essentially, getting the orientation of the picture from exif data (in c++) and then rotating the ImageView (rather than running a transform on the image data -- kind of cheating i guess).
so i guess i'm either stuck with smaller than desired images, or i need to go back and figure out how to do the transform to rotate the image data - which is not exactly what i wanted to do...