Closed eradin closed 4 years ago
We merged some fixes for splashscrens, can you test the current master and see if the problem is already fixed? You can do so by adding the platform via cordova platform add https://github.com/apache/cordova-ios.git
@timbru31 I am currently using the master branch of cordova-ios and experiencing the same issue. (only tested in the ios simulator though)
same problem when i'm use v 6.0.0 and 6.1.0-dev
@antikalk, @kamhawy4, On 6.0.0, my splash screen isn't respecting the 3 second default. It appears for about .5 seconds. Are you still seeing that on the mast branch?
@eradin There has been a PR merged into the master branch, that fixed the fast disappearing splash screen error. For me using the master branch solved my splash screen problems. Keep in mind using the master branch is not recommended for production.
For iOS you should use the preference for orientation and set value to all like this
<preference name="Orientation" value="all" />
This will set when cordova add the platform and tell the platform for iOS to make all possible orientation for iOS devices.
Please note: In the past, if you don't use the preference orientation with value all or even if you omit this preference, the orientation was set for both landscape and portrait mode (like Android), but recently you should use the preference orientation with value all to see both orientation modes.
@mosabab Thank you very much, that works for me 👍
@mosabab Shouldn't this be the default? It has been on prior versions.
The default is the Xcode default, I believe.
Default: default Allowed values: default, landscape, portrait Allows you to lock orientation and prevent the interface from rotating in response to changes in orientation. NOTE: The default value means Cordova will strip the orientation preference entry from the platform's manifest/configuration file allowing the platform to fallback to its default behavior. For iOS, to specify both portrait & landscape mode you would use the platform specific value 'all'.
https://cordova.apache.org/docs/en/latest/config_ref/index.html
@breautek That's fine but what if you don't include this directive? From everything I can find online, the ios default has always been "all" (same with android). So are you saying that the default WKWEBVIEW orientation is portrait? If that's the case, then to get "traditional legacy behavior", this directive would be mandatory. This seems odd to me as the behavior is in contrary to all previous views (i.e. UIWEBVIEW) and ios versions.
but what if you don't include this directive?
Then it defaults to default
, which is the underlying tool's default setting. Cordova doesn't impose an opinion here.
So are you saying that the default WKWEBVIEW orientation is portrait?
All I'm saying is that Cordova's default is to let Xcode (or Android SDK for android) decide what the default should be and not all
, even if default
behaviour was all
, previously. This means the default behaviour could end up changing if the underlying tools decided to change their defaults.
I don't know if this is the exact reason for the change of behaviour between cordova-ios@5 and cordova-ios@6, or between UIWebView & WKWebView. If I were to make a guess, I would think it's the difference between Xcode versions... but this is something that I think should be investigated to confirm it is indeed a regression.
Thanks for the clarification. "but this is something that I think should be investigated to confirm it is indeed a regression". Indeed.
I believe https://github.com/apache/cordova-ios/pull/615 is what caused this.
I also believe that using the platform defaults by default is the behaviour that we want, and people should use the Orientation
preference to specify behaviour for their apps.
@eradin Anyway, if you need your project to be as you need, just set the preference orientation value to all or what you need, to keep your project as you want even if the default could be change in the future.
Additional information:
I have another issue like what you mentioned here.
I was put the the preference for statusbarstyle to lightcontent or just i omit this preference (because the default value in doc is lightconent https://github.com/apache/cordova-plugin-statusbar#configxml) , and i see that Xcode always read the statusbar style to dark content (dark text, for light background).
So, I change the statusbar style manually to make light content instead of dark, because this preference <preference name="StatusBarStyle" value="lightcontent" />
is broken and not read by iOS any more.
So to fix this issue i do it manually by JS code like this:
function onDeviceReady() {
StatusBar.styleLightContent();
}
For that reason i open a new issue https://github.com/apache/cordova-plugin-statusbar/issues/192 regarding this problem.
I also believe that using the platform defaults by default is the behaviour that we want
Just double checked what a newly-created iOS project has as defaults in Xcode, and it does specify certain default rotations:
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
This will be fixed when 6.1.0 is released.
Bug Report
Problem
Build with V6.0.0, splash screen and app will always be in portrait view even when device is in landscape orientation.
What is expected to happen?
Iphone and ipad should reorient app based on orientation.
Environment, Platform, Device
Confirmed on ipad 6th gen, IOS 13
Version information
cordova 9 cli cordova-ios 6.0.0
Checklist