# Landscape mode view height issue

**URL:** <https://forum.ionicframework.com/t/landscape-mode-view-height-issue/3882>\
**Category:** ionic-v1\
**Created:** [May 7, 2014, 3:34pm UTC](https://forum.ionicframework.com/t/landscape-mode-view-height-issue/3882 "2014-05-07T15:34:10Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![enkindels2](https://avatars.discourse-cdn.com/v4/letter/e/cc9497/32.png) [@enkindels2](https://forum.ionicframework.com/u/enkindels2)\
**Post date:** [May 7, 2014, 3:34pm UTC](https://forum.ionicframework.com/t/landscape-mode-view-height-issue/3882/1 "2014-05-07T15:34:12Z")

</div>

I’m having an issue, currently tested on iPhone and iPad iOS 7.0+, where when either device is rotated into landscape mode the height is set to the width. It appears that the height and width are a box. For instance, inspecting the DOM on the iPad shows height and width both set to 1024px. Rotating the device back to portrait correctly changes the width to 768px and the height remains the same.

I’ve stripped out all code and am left with a barebones HTML page with nothing more then text and it still happens. I’ve narrowed the issue down to the ionic.js file. If I comment out that file, the page renders correctly in landscape mode. I’m not even injecting ionic into my angular app. I _assume_ this has something to do with the ionic scrolling overrides but haven’t been able to narrow down the root cause.

Has anyone come across this problem? I’m not sure where to go from here?

Here is the HTML head  
  
  
  
MiSACWIS Mobile

```
<!-- ionic css -->
<link href="lib/css/ionic.css" rel="stylesheet">
<link href="lib/css/animate.css" rel="stylesheet">

<!-- your app's css -->
<link href="css/app.css" rel="stylesheet">

<!-- angularjs scripts -->
<script src="lib/js/ionic.js"></script>
<script src="lib/js/angular/angular.js"></script>
<script src="lib/js/angular/angular-animate.js"></script>
<script src="lib/js/angular/angular-sanitize.js"></script>
<script src="lib/js/angular/angular-touch.js"></script>
<script src="lib/js/angular/angular-mocks.js"></script>
<script src="lib/js/angular-ui/angular-ui-router.js"></script>
<script src="lib/js/ionic-angular.js"></script>

```

And the Body

```
<div>
    Testing
</div>
```

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [May 7, 2014, 3:50pm UTC](https://forum.ionicframework.com/t/landscape-mode-view-height-issue/3882/2 "2014-05-07T15:50:29Z")

</div>

This is something that was done in beta 3, but we are coming out with a corrected version of for beta 4.

Can you try to reference the nightly js and see if it resolved?

```
<link href="http://code.ionicframework.com/nightly/css/ionic.min.css" rel="stylesheet">
<script src="http://code.ionicframework.com/nightly/js/ionic.bundle.js"></script>
```

---

<div class="post-metadata">

**Author:** ![enkindels2](https://avatars.discourse-cdn.com/v4/letter/e/cc9497/32.png) [@enkindels2](https://forum.ionicframework.com/u/enkindels2)\
**Post date:** [May 7, 2014, 5:08pm UTC](https://forum.ionicframework.com/t/landscape-mode-view-height-issue/3882/3 "2014-05-07T17:08:27Z")

</div>

Yes, that fixed the issue. Thank you for the reply.

---

<div class="post-metadata">

**Author:** ![jorre](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/jorre/32/64847_2.png) [@jorre](https://forum.ionicframework.com/u/jorre)\
**Post date:** [May 10, 2014, 3:30pm UTC](https://forum.ionicframework.com/t/landscape-mode-view-height-issue/3882/4 "2014-05-10T15:30:31Z")

</div>

Hey guys, I’m still facing this issue with beta 4. Should I use the nightly build or has this fix been included in beta 4?

When I rotate to landscape, everything is fine but when I rotate back to portrait, the width is equal to that of the landscape version.

The end result looks like a rotated landscape version shown in portrait mode. There will be a black area of about 20% at the bottom while the contents of the app are too wide for the screen, enabling horizontal scrolling.

I’m on an ipad 2 with ios 6.1.2

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [May 10, 2014, 4:43pm UTC](https://forum.ionicframework.com/t/landscape-mode-view-height-issue/3882/5 "2014-05-10T16:43:33Z")

</div>

Hmm this should have been taken care of in beta 4. Can you try the nightly builds? Also, can you remote inspect you app from safari and see what the actual viewport setting is being set to?

---

<div class="post-metadata">

**Author:** ![jorre](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/jorre/32/64847_2.png) [@jorre](https://forum.ionicframework.com/u/jorre)\
**Post date:** [June 4, 2014, 8:15am UTC](https://forum.ionicframework.com/t/landscape-mode-view-height-issue/3882/6 "2014-06-04T08:15:18Z")

</div>

I think this is the same problem (using beta6 of ionic). When rotating back from landscape to portrait, the width and height doesn’t respond correctly as seen on this screenshot:

In the worst case scenario I would like to block rotation, can that be done somehow?

![](https://sea1.discourse-cdn.com/ionicframework/uploads/default/885/19e480df997e1e14.png)

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [June 4, 2014, 12:56pm UTC](https://forum.ionicframework.com/t/landscape-mode-view-height-issue/3882/7 "2014-06-04T12:56:45Z")

</div>

Interesting, I haven’t had this issue on my app on iPad. I’ll see if I can get this using the nightly builds.

Anyways, yes you can prevent rotation, but it means having to open up Xcode and do it from there.

---

<div class="post-metadata">

**Author:** ![jmorel](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@jmorel](https://forum.ionicframework.com/u/jmorel)\
**Post date:** [June 27, 2014, 10:47am UTC](https://forum.ionicframework.com/t/landscape-mode-view-height-issue/3882/8 "2014-06-27T10:47:04Z")

</div>

Hi.

I have the same issue as jorre.  
I’m develloping 2 applications (beta 8) with 2 different Ipads ( Ipad 3 with IOS 6.1.3 and Ipad 2 with IOS 7.1 ).

In IOS 7.1 ( Ipad 2 ) the application rotates perfectly for both applications.

But, in IOS 6.1.3 ( Ipad 3 ) the black stripe appears.  
Here are some screenshots for illustration :

When i launch the application ( portrait ) everything is ok.

![](https://sea1.discourse-cdn.com/ionicframework/uploads/default/1103/cd1f66c620fb772c.PNG)

1rst rotate, everything fine too.

![](https://sea1.discourse-cdn.com/ionicframework/uploads/default/1104/74da843d5a8d6243.PNG)

After the 2nd rotate, the webview keeps the dimensions of the landscape view. Consequently, allowing for an horizontal scroll and revealing a black stripe. ( the stripe is not described in the HTML inspector)

![](https://sea1.discourse-cdn.com/ionicframework/uploads/default/1105/723400c03b122681.PNG) From then on, whatever I do the view keeps the landscape dimension and the black stripe stays at the bottom.

This issue appears in both applications but only for IOS 6.1.3. The width and height don’t adjust like jorre says.

Don’t hesitate to ask me for more precisions if you need any.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [June 27, 2014, 12:46pm UTC](https://forum.ionicframework.com/t/landscape-mode-view-height-issue/3882/9 "2014-06-27T12:46:19Z")

</div>

What does your viewport look like?

Try this one.

```
<meta name="viewport" content="initial-scale=1, user-scalable=no">
```

---

<div class="post-metadata">

**Author:** ![jmorel](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@jmorel](https://forum.ionicframework.com/u/jmorel)\
**Post date:** [June 27, 2014, 2:26pm UTC](https://forum.ionicframework.com/t/landscape-mode-view-height-issue/3882/10 "2014-06-27T14:26:53Z")

</div>

here my viewport :  
`<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">`

I try with `<meta name="viewport" content="initial-scale=1, user-scalable=no">` but i get the same issue

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [June 30, 2014, 1:15am UTC](https://forum.ionicframework.com/t/landscape-mode-view-height-issue/3882/11 "2014-06-30T01:15:32Z")

</div>

Hey sorry for the delay, I was on vacation for a few days.

So first off, I’m pretty sure we are dropping support for iOS 6 all together. Apple requires all apps that are built for iOS 7

> **[Apple to require all new App Store submissions to be “optimized for iOS 7,”...](https://9to5mac.com/2013/12/17/apple-to-require-all-new-app-store-submissions-to-be-optimized-for-ios-7-built-with-latest-xcode/)**
>
> Apple has just published a notice to developers on its dev center that all new apps submitted after February 1st, 2014 must be built with the latest version of Xcode 5 and “must be optimized …

[https://developer.apple.com/news/index.php?id=12172013a#top](https://developer.apple.com/news/index.php?id=12172013a#top)

So your issue shouldn’t be a problem since apple is require ios 7 be the new minimum version

---

<div class="post-metadata">

**Author:** ![jmorel](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@jmorel](https://forum.ionicframework.com/u/jmorel)\
**Post date:** [July 7, 2014, 9:11am UTC](https://forum.ionicframework.com/t/landscape-mode-view-height-issue/3882/12 "2014-07-07T09:11:04Z")

</div>

Hi!  
I have checked your link and Apple didn’t drop the IOS 6 support yet. We are forced to build for IOS 7 but still need to support IOS 6.

As long as IOS 6 is supported by Apple, we will need to support it ourselves for our clients.

Is there any ways to fix or hack for this issue ?

---

<div class="post-metadata">

**Author:** ![RyanBrewtown](https://avatars.discourse-cdn.com/v4/letter/r/e36b37/32.png) [@RyanBrewtown](https://forum.ionicframework.com/u/RyanBrewtown)\
**Post date:** [October 7, 2014, 6:40pm UTC](https://forum.ionicframework.com/t/landscape-mode-view-height-issue/3882/13 "2014-10-07T18:40:16Z")

</div>

This is still an issue for us in iOS7 and iOS8 on the iPad - see photos at the bottom of this thread… We’ve set the app’s device orientation to portrait in Deployment Info, and our viewport tag reads `<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">`. I’ve tried every viewport configuration mentioned in this thread and that I can find on Stack Overflow, all to no avail.

I’ve also tried various Objective-C fixes, as my hunch is that the webview itself isn’t being resized to fit its container? The look and feel of it is that, when the orientation changes to landscape, the webview retains the width and height of it’s previous dimensions but is then shoved into a portrait container.  
Running v1.0.0-beta.13, and did give nightly a shot but no change. Any help would be greatly appreciated!

Looking good on my iPad Mini 2 (iOS 8) in portrait mode.  
 ![](https://sea1.discourse-cdn.com/ionicframework/uploads/default/4425/617ce468541eaa95.png)

I’ve killed the app, then reopened it in landscape mode:  
 ![](https://sea1.discourse-cdn.com/ionicframework/uploads/default/4426/6c1acc04bf6a3b77.png)

TL;DR - Why the black spacing at the bottom?

EDIT: Can confirm that this issue is present in the Ionic blank starter template with zero alterations:

Portrait on iPad Mini 2 iOS 8:  
 ![](https://sea1.discourse-cdn.com/ionicframework/uploads/default/4427/e302ffdaefb16370.png)

Same after restarting in landscape:  
 ![](https://sea1.discourse-cdn.com/ionicframework/uploads/default/4428/bfd1e69f1873d40d.png)

---

<div class="post-metadata">

**Author:** ![benholz](https://avatars.discourse-cdn.com/v4/letter/b/47e85d/32.png) [@benholz](https://forum.ionicframework.com/u/benholz)\
**Post date:** [October 8, 2014, 8:31pm UTC](https://forum.ionicframework.com/t/landscape-mode-view-height-issue/3882/14 "2014-10-08T20:31:12Z")

</div>

I’m running into a similar problem with landscape (on the iPhone). I’m running my app inside the Safari browser. Everything is fine in portrait but when I switch to landscape, the page is shifted up. After testing on multiple devices this bug only appears in iOS 7.1+ (tested with 7.1.1 and 7.1.2). On an iPhone with 7.0.4 it works fine. I also discovered that the bug only appears inside Safari - if I launch as a web app, it works fine in all iOS versions. I’m also using v1.0.0-Beta 13.

---

<div class="post-metadata">

**Author:** ![Chriz](https://avatars.discourse-cdn.com/v4/letter/c/7feea3/32.png) [@Chriz](https://forum.ionicframework.com/u/Chriz)\
**Post date:** [October 22, 2014, 8:42am UTC](https://forum.ionicframework.com/t/landscape-mode-view-height-issue/3882/15 "2014-10-22T08:42:03Z")

</div>

I was running into the same problem (only on iPad with iOS 8). I was able to get rid of it by updating to latest versions of cordova and ionic.

---

<div class="post-metadata">

**Author:** ![madansingh18](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@madansingh18](https://forum.ionicframework.com/u/madansingh18)\
**Post date:** [October 28, 2014, 10:16am UTC](https://forum.ionicframework.com/t/landscape-mode-view-height-issue/3882/16 "2014-10-28T10:16:45Z")

</div>

Hi ionic Team,

I am also facing the same problem. How can i solve it and idea?

Thanks,  
Madan

---

<div class="post-metadata">

**Author:** ![hoomanb](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/hoomanb/32/66114_2.png) [@hoomanb](https://forum.ionicframework.com/u/hoomanb)\
**Post date:** [March 12, 2015, 3:26pm UTC](https://forum.ionicframework.com/t/landscape-mode-view-height-issue/3882/18 "2015-03-12T15:26:26Z")

</div>

Anyone managed to resolve this?  
I’m having the same issue on the latest nightlies.  
This is my view-port:
