![]() Then just call it with isPortrait() to get a boolean with value true if the window is oriented in portrait and false if it’s oriented in landscape. Return (Ti.Platform.displa圜aps.platformHeight > Ti.Platform.displa圜aps.platformWidth) Here is the function, quite obvious, really: So I made a custom function, based on window size, which turns out to be defined early enough for me. Revealed that the variable sadly is undefined at that stage (TBH, I didn’t check if it was defined later since that’s not where I need it). If(Titanium.UI.Window.orientation=Titanium.UI.PORTRAIT) Ĭonsole.log(Titanium.UI.Window.orientation) In an application I’m developing, I needed to check the window orientation right at start-up, more specifically I used this: Titanium provides a simple way to detect window orientation, Titanium.UI.Window.orientation, but it seems to initialize late.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |