Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15308] blob.getHeight() crashes app in iOS simulator and raise error on Android while .height succeeds

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsblob, crash, getHeight, height, timob, toImage
ReporterHenry David Spells III
AssigneeUnknown
Created2013-09-20T22:51:49.000+0000
Updated2018-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; }

Comments

No comments

JSON Source