Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-437] height auto on row does not work with web view height auto

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:53:03.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.1.0
ComponentsiOS
Labelsios, iphone
ReporterNolan Wright
AssigneeJeff Haynie
Created2011-04-15T02:29:18.000+0000
Updated2011-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();

Comments

  1. Blain Hamon 2011-04-15

    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.

  2. Blain Hamon 2011-04-15

    Linking to issue #509, which is a more accurate reason of the problem.

  3. Jeff Haynie 2011-04-15

    (from [2fdbd20b82603d96e720b868ffc901bfdba8bede]) Closes #437 http://github.com/appcelerator/titanium_mobile/commit/2fdbd20b82603d96e720b868ffc901bfdba8bede"> http://github.com/appcelerator/titanium_mobile/commit/2fdbd20b82603...

JSON Source