在我的代码中,我这样做:
var taskLabel = Ti.UI.createLabel({color:'#777', top:3, textAlign:'center', height:'auto', text:task.title});
Ti.API.info('Next info is: taskLabel.height');
Ti.API.info(taskLabel.height);但是,由此产生的输出是:
[INFO] [123,883] Next info is: taskLabel.height除此之外,它看起来像是静默地中断,但基于the API,我猜它不应该这样。
我试图对元素的高度进行求和,但我更希望它表现得像html postion:relative。不管怎样,我想读取浮点数中的高度,我该如何实现呢?
发布于 2012-09-02 15:08:07
这应该是可行的。
var lbl_obj = Ti.UI.createLabel( { height: 'auto', text:'Test Label', top:10 } );
var height = lbl_obj.toImage().height;
Ti.API.info(height);https://stackoverflow.com/questions/5614537
复制相似问题