Screen Orientation Bug
See original GitHub issueShort description of the problem:
WebView is resized to incorrect size after orientation change
What behavior are you expecting?
Expected app to cover entire width of the screen, but the web app (i.e. the WebView) is narrower than the complete width
The problem is that once the device is in landscape mode and the app is started. When programmatically setting the orientation to portrait, it INTERMITTENTLY fails
Steps to reproduce:
- ionic start myApp tabs
- cd myApp
- cordova platform add ios@4.2.0
- cordova plugin add cordova-plugin-screen-orientation
- vim config.xml # add
<preference name="Orientation" value="all" />
- vim www/js/app.js # add in the ready callback
screen.lockOrientation('portrait');
- ionic build ios
- Build and run from Xcode
I ran on iPad mini (iPad2,5) with iOS 9.3
Other information:
Couldn’t reproduce the problem with a vanilla Cordova app
Which Ionic Version? 1.3.1
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
iOS 16 auto-rotate bugged, content appears in top half of screen
Many iOS 16 users are facing an auto-rotate bug where content appears only in top half of lock screen when in landscape mode....
Read more >iOS 16 unexpected rotation behaviour - Apple Developer
Then if we dismiss/pop back to Master screen, the app again unexpectedly rotates from Portrait to Landscape with no animations. Looks like a...
Read more >How to fix iPad iMessage screen rotation problem ... - iKream
First solution: Clear all background apps to fix screen rotation bug on your iPad. It's possible that your iPad or iMessage gets stuck...
Read more >How to Fix Auto Rotate Not Working on Android
Fix Auto-Rotate Issues by Restarting Your Android Phone · Turn On Screen Rotation From Android Settings · Use the In-App Screen Rotation Option....
Read more >7 ways to fix Android screen rotation not working - Carlcare
7 ways to fix Android screen rotation not working · Restart your phone · Check Auto-rotation settings · Calibrate phone's sensors · Check...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I tracked this down. cordova-ios sets
autoresizesSubviews
to true and the screen orientation plugin presents a view controller after forcing orientation (I’m assuming to solve some corner case). This seems to cause a race condition where two resizes trigger at the same time and we end up with the width incorrectly set. When using the plugin the autoresizesSubviews should be set to false in the app delegateActually, it’s not a Cordova problem. It is a conflict between Cordova and a plugin used by Ionic’s project. So it should be fixed by Ionic bundle since the starter app has the problem 😃