[ 
https://issues.apache.org/jira/browse/CB-8047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14394911#comment-14394911
 ] 

Winston commented on CB-8047:
-----------------------------

We've found a work around to this problem. 

In the generated Cordova MainViewController.m, there is a method that 
determines what orientations should be permitted. The default implementation is 
to call your javascript app. I haven't dug into why this fails but I'd suspect 
with WKWebView, javascript is not yet running. So the default implementation 
returns NO for all supported orientations. If you override it to return YES, 
then orientations work fine. See code snippet below.

```
- 
(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    // return [super 
shouldAutorotateToInterfaceOrientation:interfaceOrientation];
    return YES; // WKWebView doesn't respond properly yet, so allow all 
orientations
}
```

> [WKWebView][iOS8] wkwebview / local webserver plugin orientation issue
> ----------------------------------------------------------------------
>
>                 Key: CB-8047
>                 URL: https://issues.apache.org/jira/browse/CB-8047
>             Project: Apache Cordova
>          Issue Type: Sub-task
>          Components: iOS
>         Environment: IOS
>            Reporter: Dustin Nielson
>            Assignee: Shazron Abdullah
>
> After installing the `wkwebview-engine` plugin on ios device (tested iPhone 
> 6, iPad mini 2, iPad retina) and enabling all orientations in xcode.  Upon 
> successful build the devices have fixed portrait orientation that doesn't 
> change when device is rotated.
> The `wkwebview` branch of cordova-ios was used. This problem does not occur 
> in the `master` branch.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to