PDA

View Full Version : BLOCKING PORTRAIT VIEW



deepaknair.g
20 Nov 2011, 7:46 AM
Hi all,
I want my application to run only in LANDSCAPE view.How can I block the portrait view?:)

mitchellsimoens
20 Nov 2011, 12:54 PM
I don't believe you can do this. I could be 100% wrong

AndreaCammarata
21 Nov 2011, 2:30 AM
Hi all,
I want my application to run only in LANDSCAPE view.How can I block the portrait view?:)

Is your app running on the www or did you wrap it inside a native app?
If you wrap it inside a native app you can easily achieve that.

However, you could use a simple trick on web apps:
You should monitoring the browser orientation change and when it has been detected, you should just get the page body and rotate it back to its original position using the css rule "-webkit-transform".
For istance:



-webkit-transform: rotate(90)


I'm not sure if it works because I've never tried but it could be a (not elegant) solution.

Hope this helps.