[TIMOB-437] height auto on row does not work with web view height auto
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:53:03.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.1.0 |
Components | iOS |
Labels | ios, iphone |
Reporter | Nolan Wright |
Assignee | Jeff Haynie |
Created | 2011-04-15T02:29:18.000+0000 |
Updated | 2011-04-17T01:53:03.000+0000 |
Description
see test case:
var win= Ti.UI.createWindow();
var headerView = Ti.UI.createLabel({
color:'white',
text:'Quick bits of info'
});
var row = Ti.UI.createTableViewRow({height:'auto'});
var html= '<html><body><table ><tr><td style="font-weight:bold;color:#111" valign="top" width="100">Label</td><td valign="top">I am a lot of text that may wrap or may not</td></tr>';
html+= '<tr><td style="font-weight:bold">Label</td><td>I am a lot of text that may wrap or may not</td></tr></table></body></html>';
var wv = Ti.UI.createWebView({top:10,bottom:10,html:html, height:'auto'});
row.add(wv);
// create table view
var tableview = Titanium.UI.createTableView({
data:[row],
style: Titanium.UI.iPhone.TableViewStyle.GROUPED
});
win.add(tableview);
win.open();
Possible concerns:
To get the auto height of a web view (Like in 0.8) the javascript of document.height was used. However, that number is valid only after the page loads. Using the standard page loading calls, that only happens during NSDefaultRunLoopMode, (why web pages in 0.6 or so wouldn't load in a table view while scrolling.)
The workaround was to cheat and doing a document.write() to force HTML into the dom of about:blank, but this happens synchronously. I fear that heavy use will block the UI in ways that normal page loadings don't.
And even then, testing with document.height and document.width was often very touchy.
Linking to issue #509, which is a more accurate reason of the problem.
(from [2fdbd20b82603d96e720b868ffc901bfdba8bede]) Closes #437 http://github.com/appcelerator/titanium_mobile/commit/2fdbd20b82603d96e720b868ffc901bfdba8bede"> http://github.com/appcelerator/titanium_mobile/commit/2fdbd20b82603...