{ "id": "155789", "key": "TIMOB-20587", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2019-08-27T17:37:09.000+0000", "created": "2016-03-17T04:38:12.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "scrollableview", "webview" ], "versions": [], "issuelinks": [ { "id": "52255", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "159137", "key": "TIMOB-23123", "fields": { "summary": "Titanium.UI.SIZE : Webview is taking height more than the contents on iOS", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": null, "updated": "2019-08-27T17:37:09.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h5.Reproduce Step\r\n1. Simply run the example following\r\n{code}\r\nTitanium.UI.setBackgroundColor('#000');\r\n \r\nvar window = Titanium.UI.createWindow({\r\n\tbackgroundColor : \"white\"\r\n});\r\n \r\n//Create WebView\r\nvar webview = Titanium.UI.createWebView({\r\n\theight: Ti.UI.SIZE,\r\n\tborderColor: \"orange\"\r\n});\r\nwebview.setHtml(\"

What you get

Two tickets to the National Home Show and Canada Blooms Garden Festival on March 11-20, 2016 at the Enercare Centre at Exhibition Place.


Today\\'s WagJag: $20 for two tickets to the National Home Show and Canada Blooms Garden Festival on March 11-20, 2016 at the Enercare Centre (a $40 value).

The National Home Show presented by RE/MAX & co-located Canada Blooms bring you the largest North American display of innovative products, new ideas, & great deals for all things home & garden with over 700 retailers & industry experts. Tour the FutureDreamHome built by Probuilt and presented by Toronto Star, and explore the Best Buy Smart Home for a taste of what tomorrow has in store for us. Plus, be inspired by our line-up of celebrity guests and experts on the Unilock Celebrity Stage including, Debbie Travis, Paul Lafrance, Carson Arthur, Damon Bennett, Annie Sloan and more! One ticket, two events. Admission to Canada Blooms in included when you attend the National Home Show. Whether you need inspiration for your next project, are looking some practical advice or need some face to face time with experts from a variety of trades, make sure don\\'t miss the largest home and garden event in North America!
\");\r\n\r\nwebview.addEventListener('load', function (e){\r\n\tconsole.info('e.source.height: ' + e.source.evalJS(\"document.height;\"));\r\n});\r\n\r\n//Create scrollView\r\nvar scrollView = Ti.UI.createScrollView({\r\n\ttop : 50,\r\n});\r\nscrollView.add(webview);\r\nwindow.add(scrollView);\r\n \r\nwindow.open();\r\n{code}\r\n\r\nh5.Expect Result\r\nThe webView should display well inside scrollView.\r\n\r\nh5.Actual Result\r\nThere will be a large while blank space on the bottom of the page\r\n\r\nh5.N.B.\r\n1. If you comment out the \"height: Ti.UI.SIZE\" from webview properties, everthing will work well.\r\n2. If you ONLY display the webview in screen, NO any scrollView, it will work well too.\r\n\r\nAlso customer mentioned that it was not happening on iOS 8.", "attachment": [], "flagged": false, "summary": "IOS9: Ti.UI.SIZE is not working well for WebView inside a ScrollView", "creator": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "subtasks": [], "reporter": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "environment": "iOS 9.2\r\nTI SDK 5.2.0\r\niPhone 6puls ", "comment": { "comments": [ { "id": "382003", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Any update on this? Customer asked for ETA to fix it", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2016-04-07T01:04:28.000+0000", "updated": "2016-04-07T01:15:47.000+0000" }, { "id": "382005", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "No priorities are set for now because we moving into auto layout, and there's already a workaround as stated above.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-07T01:12:37.000+0000", "updated": "2016-04-07T01:12:37.000+0000" }, { "id": "382015", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "yes.", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2016-04-07T01:46:22.000+0000", "updated": "2016-04-07T01:46:22.000+0000" }, { "id": "382379", "author": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~sliang] Hi ,unfortunately we cannot size the webView based on remote data. The webView requires the view container to be sized depending on the children within it, which we do not have in this case. I've been investigating this issue for some time and found some implementations that would size the webView depending on the remote content. However they would override a lot of our layout code and are not the best practice. Also just like Kiat mentioned you should not have a webView inside a scrollView as it can cause native issues its actually mentioned inside apples [docs|https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIWebView_Class/]. A workaround solution would be to use a clean source for the remote data and set the webView to vertical. ", "updateAuthor": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-11T23:38:52.000+0000", "updated": "2016-04-11T23:39:59.000+0000" }, { "id": "382579", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I will sum this up: A WebView displays HTML content. Using Ti.UI.FILL (default) for the width and height displays the WebView container and it's content. The thing is, that the WebView doesn't know about the inner-sizing of the HTML, so if you set a height/width to TiUI.SIZE, it won't be able (natively) to determine the size of the DOM that can change even after the page is loaded. That's why WebViews should not be used for sizable content because of it's layout restrictions. \r\n\r\nClean source thereby means, that developers should for example use a JSON-based API and display the data inside a ListView and/or vertical layout. So using a WebView within a ScrollView isn't good practice and not recommended by Apple as well. Although I'm wondering why it worked in iOS 8, I'm guess it doesn't because Apple simply didn't support it anymore.\r\n\r\nBecause we want to solve this anyway, here are some attempts how the issue could be handled:\r\na) Deliver the data using a clean API and display it in native elements (of course it requires data changes, but should be discussed in long-term)\r\nb) Parse the DOM and create native labels from it inside a vertical layout (fallback for a)) \r\nc) Move the content to an own page using a \"read more\" button and present it fullscreen there. Use another static-height webview to display the preview, so the scrollView won't be needed anymore. (workaround)", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-04-13T09:27:31.000+0000", "updated": "2016-04-13T09:27:31.000+0000" }, { "id": "450867", "author": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing per developer comments.", "updateAuthor": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-08-27T17:37:09.000+0000", "updated": "2019-08-27T17:37:09.000+0000" } ], "maxResults": 17, "total": 17, "startAt": 0 } } }