Mike Kwan created CB-5373:
-----------------------------
Summary: CDVViewController does not support UIWebView not at (0, 0)
Key: CB-5373
URL: https://issues.apache.org/jira/browse/CB-5373
Project: Apache Cordova
Issue Type: Bug
Components: iOS
Affects Versions: 3.1.0
Reporter: Mike Kwan
*CDVViewController* does not play well with the *HideKeyboardFormAccessoryBar*
set to *true* when the *UIWebView* has its origin shifted.
To reproduce this:
- Create skeleton project via CLI
- Configure *content src* to *http://www.google.co.uk/*
- Configure *HideKeyboardFormAccessoryBar* to *true*
- In the MainViewController add the following method:
{code}- (void)viewDidLoad
{
[super viewDidLoad];
CGRect frame = [[self view] bounds];
frame.origin.y += 20;
frame.size.height -= 20;
[self.webView setFrame:frame];
}{code}
The reason the bug occurs is because of the following line in
*CDVViewController*:
{code}self.webView.scrollView.frame = self.webView.frame;{code}
This will work as expected only if the *scrollView* origin matches the
*UIWebView* origin which happens only at (0, 0). The correct code should be:
{code}self.webView.scrollView.frame = CGRectMake(0, 0,
self.webView.frame.size.width, self.webView.frame.size.height);{code}
--
This message was sent by Atlassian JIRA
(v6.1#6144)