[TIMOB-15308] blob.getHeight() crashes app in iOS simulator and raise error on Android while .height succeeds
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | blob, crash, getHeight, height, timob, toImage |
Reporter | Henry David Spells III |
Assignee | Unknown |
Created | 2013-09-20T22:51:49.000+0000 |
Updated | 2018-02-28T20:04:20.000+0000 |
Description
function labelHeight(sOutText, daFont, iWidth)
{
if (typeof sOutText === undefined || sOutText === null || sOutText == '')
return 0;
var daLabel = Ti.UI.createLabel(
{
font: daFont,
color: 'black',
backgroundColor:'transparent',
layout: 'vertical',
height: 'auto',
width: iWidth + 'dp',
text: sOutText,
horizontalWrap: true,
textAlign: Ti.UI.TEXT_ALIGNMENT_LEFT,
verticalAlign: Ti.UI.TEXT_VERTICAL_ALIGNMENT_TOP
});
var blob = daLabel.toImage();
var size = daLabel.getSize();
var iWidth = size.width;
var iHeight = size.height;
iHeight = blob.height; // <-- this succeeds
iHeight = blob.getHeight(); // <-- this crashes
return iHeight;
}
No comments