# Screen orientation issue

**URL:** <https://forum.ionicframework.com/t/screen-orientation-issue/54453>\
**Category:** ionic-v3\
**Created:** [June 10, 2016, 11:59am UTC](https://forum.ionicframework.com/t/screen-orientation-issue/54453 "2016-06-10T11:59:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![skoff](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/skoff/32/100985_2.png) [@skoff](https://forum.ionicframework.com/u/skoff)\
**Post date:** [June 10, 2016, 11:59am UTC](https://forum.ionicframework.com/t/screen-orientation-issue/54453/1 "2016-06-10T11:59:34Z")

</div>

Hi,

I searched here and google to find an answer and nothing seems to be truly clear about doing it in ionic 2. I’m trying to lock the screen orientation:

```auto
this.platform.ready().then(() => {
     screen.lockOrientation('landscape'); 
}
```

this doesn’t work.I’m still able to switch from portrait to landscape. I don’t know if I miss any config? I read something about the config.xml file but doesn’t seem to work either.

I’m testing from the IonicView app on my iPhone 6s.

If you guys could help me figure this out!!

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![vijquick](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/vijquick/32/103086_2.png) [@vijquick](https://forum.ionicframework.com/u/vijquick)\
**Post date:** [June 10, 2016, 1:25pm UTC](https://forum.ionicframework.com/t/screen-orientation-issue/54453/2 "2016-06-10T13:25:08Z")

</div>

Hello @skoff

I was also looking for this and found [here](https://gist.github.com/dwayne/308ed0f19eb1504aca43#how-to-force-an-orientation) .As per that we need to set **Orientation** in **config.xml**. Basically it is a cordova configuration that we specify using config.xml in the project. I didn’t test it though, may be you can test it and please let me know if it works for you.

Please look at [this link](https://cordova.apache.org/docs/en/latest/config_ref/) for more configuration options.

 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/c/b/cbfde83ac90aa4d7c85aa8b0c6bf4807bfff1765.png)

Regards  
Vijay

---

<div class="post-metadata">

**Author:** ![skoff](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/skoff/32/100985_2.png) [@skoff](https://forum.ionicframework.com/u/skoff)\
**Post date:** [June 10, 2016, 1:35pm UTC](https://forum.ionicframework.com/t/screen-orientation-issue/54453/3 "2016-06-10T13:35:13Z")

</div>

I’ll try that maybe tonight or tomorrow morning and let you know!

many thanks!

---

<div class="post-metadata">

**Author:** ![skoff](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/skoff/32/100985_2.png) [@skoff](https://forum.ionicframework.com/u/skoff)\
**Post date:** [June 10, 2016, 6:59pm UTC](https://forum.ionicframework.com/t/screen-orientation-issue/54453/5 "2016-06-10T18:59:39Z")

</div>

the only problem I can see with the first link you provide is that I would like to force the orientation on a single specific view and that can’t be done with adding the config inside config.xml. I would like to know if there’s a way to make it work without the config.xml for only one specific view.
