Monica
Monica

Reputation: 1534

How to handle only landscape orientation on my app?

I am building an app mainly for tablet or iPad, but I just noticed that the design is meant to only for landscape view. I tried the portrait and it doesn't look good. Though before I keep programming the app I want to know how I can handle this, or prevent the user to see the app in portrait.

I checked and I know that for android I can use something like this: android:screenOrientation="sensorLandscape"

but what about iPad? I would like to have something more "universal" if I can say

I am using HTML5, JQuery and to handle the swipes I am using Hammerjs nothing else, I didn't use any mobile framework, cause it's more of a carousel with some text and images.

Upvotes: 0

Views: 117

Answers (1)

JeanLuc
JeanLuc

Reputation: 4893

on iOS it's a simple configuration in the Xcode App Target, where you just allow Landscape Left and Landscape Right.

if you are using UIKit for building the app, you can configure it for every instance of UIViewController

UPDATE: (Solution for HTML)

combine the css rule "transform: rotate(90deg)" with css media queries on device orientation, but it will be tricky to get everthing to run properly....

Upvotes: 1

Related Questions