开发者

Titanium webview crashes when adding a row to html table

开发者 https://www.devze.com 2023-03-22 17:56 出处:网络
I have webview with inline html as a part of my window. It contains an html table with around 10 rows. When I try to add 1 more row to the table the app crashes.

I have webview with inline html as a part of my window. It contains an html table with around 10 rows. When I try to add 1 more row to the table the app crashes.

    webView = Titanium.UI.createWebView({
        scalesPageToFit:false,
        top:0,
        bottom:0
    });

    var html = '<html>'+
    '<body>'+
    '<table width="98%" align="center" border="0" cellspacing="0" cellpadding="0">'+
    '<tr>'+
    '<td align="left" height="25" colspan="2" style="color:#ba2424; font-size:14; font-weight:bold">Use RedAnar To:</td>'+
    '</tr>'+
    '<tr>'+
    '<td width="10%" height="25"><img src="'+sc+'"></td>'+
    '<td width="90%" height="25" style="color:#000; font-size:14; font-weight:bold">Store Card Data</td>'+
    '</tr>'+
    '<tr>'+
    '<td width="10%" height="25"><img src="'+eo+'"></td>'+
    '<td width="90%" height="25" style="color:#000; font-size:14; font-weight:bold">Explore Offers</td>'+
    '</tr>'+
    '<tr>'+
    '<td width="10%" height="25"><img src="'+cl+'"></td>'+
    '<td width="90%" height="25" style="color:#000; font-size:14; font-weight:bold">Capture Loyalty</td>'+
    '</tr>'+
    '<tr>'+
    '<td width="10%" height="25"><img src="'+tp+'"></td>'+
    '<td width="90%" height="25" style="color:#000; font-size:14; font-weight:bold">Track Points</td>'+
    '</tr>'+
    '<tr>'+
    '<td width="10%" height="25"><img src="'+vb+'" valign="absmiddle"></td>'+
    '<td width="90%" height="25" style="color:#000; font-size:14; font-weight:bold">View Balances</td>'+
    '</tr>'+
    '<tr>'+
    '<td align="left" height="25" colspan="2" style="color:#ba2424; font-size:14; font-weight:bold">Card Description</td>'+开发者_如何学运维
    '</tr>'+
    '<tr>'+
    '<td align="left" height="20" colspan="2" style="color:#000; font-size:14; font-weight:normal">'+description+'</td>'+
    '</tr>'+
    '<tr>'+
    '<td align="left" height="25" colspan="2" style="color:#ba2424; font-size:14; font-weight:bold">Highlights</td>'+
    '</tr>'+
    '<tr>'+
    '<td align="left" height="20" colspan="2" style="color:#000; font-size:14; font-weight:normal">'+highlights+'</td>'+
    '</tr>'+
    '</table>'+
    '</body>'+
    '</html>';

    webView.html = html;

if i try inserting 1 more row after this the app will crash. Any suggestions?


I've just tested your code, and it worked (I have used your variables as text though, because I don't know what's in them).

I've added the following line at the end, and it worked too:

'</tr>'+
'<tr>'+
'<td align="left" height="20" colspan="2" style="color:#000; font-size:14; font-weight:normal">'+"highlights"+'</td>'+
'</tr>'+

What line do you add when it doesn't work? And what error does it give when it crashes?

0

精彩评论

暂无评论...
验证码 换一张
取 消