[TIMOB-4371] Android: webview content height and width too large
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Won't Do |
Resolution Date | 2020-01-09T19:52:26.000+0000 |
Affected Version/s | Release 1.7.0, Release 2.1.0 |
Fix Version/s | Sprint 2011-29 |
Components | Android |
Labels | core |
Reporter | Ben S. |
Assignee | Unknown |
Created | 2011-06-04T01:26:34.000+0000 |
Updated | 2020-01-10T10:30:59.000+0000 |
Description
Since 1.7.0, webview content on Android is way too long and wide by default. This leads to a webview where you can scroll way too much to the right and the bottom with no more content being visible inside the webview.
On 1.6.3 the height and width of a webview was properly adopted to the text length and the width/height properties. Here's an example code snippet you can run:
app.js:
Titanium.UI.setBackgroundColor('black');
var win = Titanium.UI.createWindow();
var webview = Titanium.UI.createWebView({
html:"This is some text inside a webview...it's not very long, but demonstrates what it should",
height:150,
width:300,
autoDetect:[],
scalesPageToFit:false,
backgroundColor:"white",
left:10,
top:100,
color:"black"
});
win.add(webview);
win.open();
On 1.6.3 this will look just fine, no scrollbars appear in the webview. Since 1.7.0 you will get a webview where you can scroll vertically and horizontally way beyond the size / length of the visible text.
Attachments
File | Date | Size |
---|---|---|
1.6.3.jpg | 2011-06-04T01:26:34.000+0000 | 65690 |
1.7.0.jpg | 2011-06-04T01:26:34.000+0000 | 105139 |
Ben Note that in the emulator only, webviews are broken on Android 2.3.X. See [Android SDK / Target Android Platform](http://wiki.appcelerator.org/display/guides/Titanium+Compatibility+Matrix#TitaniumCompatibilityMatrix-AndroidSDK%2FTargetAndroidPlatform) for more info. Other than this, great ticket! I wish more of them were like this. ;)
Associated Helpdesk ticket
appc.me/c/APP-599983Opie, triage this please. I'm guessing the difference in display is when we switched to anyDensity:true. I'm wondering if the scroll buttons are causing the page to be larger.
Behavior is a side effect of using wide viewport in order to support double tap zoom. Webview size issue can be addressed by setting dimensions in dips. Default zoom behavior can be modified to not load in a zoomed in state by setting "scalesPageToFit:false"
created ticket #4744 for new feature request to support specifying the type of viewport that should be used when creating a webview
Hi, I'm using anyDensity:false in my android applications. What if I want the webview to set its width and height automatically? I can't see how to prevent this behaviour then...the webview automatically still is way too high and too wide... do I always have to check the screen dimensions and adopt the webview size with SDK 1.7 ?
Hello, A customer opened a ticket, reporting the same issue. I did try setting anyDensity to true/false, but nothing seems to help. The WebView is set to be Ti.UI.SIZE large, but I still see the scrollbars. Is there any way to fix this? I'm using SDK 2.1.0 GA
It has been decided that this issue should be closed as “Won’t do.” This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. If community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.
Closing ticket as it is marked as
Won't Do
.