0
votes

Is there a way to specify two different viewports, one for portrait and one for landscape mode, in the ipad?

I have a page that seem to be needing two different values for things to look ok. Is this possible?

I need (in portrait mode): meta name="viewport" content="width=device-width, initial-scale=0.7, maximum-scale=1.0"

And (in landscape): meta name="viewport" content="width=device-width, initial-scale=1.0"

1

1 Answers

0
votes

You can use a simple conditional

if (self.interfaceOrientation == UIInterfaceOrientationPortrait ||
    self.interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
    // do stuff for portrait
} else {
    // do other stuff for landscape
}