saqimtiaz / hesperian-mhealth-pregnancy-warning-signs

Mobile app using Hesperian content about warning signs during pregnancy
MIT License
4 stars 3 forks source link

Lock orientation to portrait mode #4

Closed mlitwin closed 13 years ago

mlitwin commented 13 years ago

We've decided to design our content to work well in portrait mode and not landscape, so it's desirable to force that mode if we can.

I've done a quick look at the question of how to lock the orientation of our mobile web app to portrait mode.

It seems not to be possible to do in html, at least on the iPhone. Mobile Safari won't let you lock the orientation. I'm reading about pretty hack-ish attempts to simulate orientation locking by responding to the orientation change in such a way that it doesn't seem like anything happened. Doesn't seem viable. See http://stackoverflow.com/questions/1207008/how-do-i-lock-the-orientation-to-portrait-mode-in-a-iphone-web-application. Am I missing some HTML trick you (or Eric) might know about?

However, the good news is that once you've embedded the html in a native iPhone app, orientation change isn't supported by default - you need to code that support. I've verified that in my phonegap prototype (though judging from the simulator, the iPad does in fact do an orientation change) . So if there's any code needed, it will probably be on the app side.

saqimtiaz commented 13 years ago

Orientation is locked to portrait mode in the iphone version of our phonegap build. This will likely need further work for the iPad, however suggest we open a separate ticket for that when the need arises.