Hi!
I’m trying to implement an app that on small screens (smartphones) is ONLY on portrait mode and on larger screens (tablets & browser) is ONLY on landscape mode.
Is there any configuration on ionic 2 that I can use to achieve this?
Thanks
Hi!
I’m trying to implement an app that on small screens (smartphones) is ONLY on portrait mode and on larger screens (tablets & browser) is ONLY on landscape mode.
Is there any configuration on ionic 2 that I can use to achieve this?
Thanks
This might not be the best solution to this problem, someone with a bit more experience might be able to give a better one. But you could try combining Content with Screen Orientation.
In the end your function would look something like this.
var contentWidth = this.content.getContentDimensions().contentWidth;
if(contentWidth < 768) {
ScreenOrientation.lockOrientation('portrait');
}
else {
ScreenOrientation.lockOrientation('landscape');
}