나는 이것을 작업하고 있었고 위의 코드에서 안드로이드를 테스트하는 3.2.2를 사용하여 문제가있었습니다. 다양한 시도는 너비와 높이 값에 대해 1, 0 또는 SIZE를 제공합니다. 이것은 imageView를 사용하지만 다음은이 환경에서 필요한 모든 것을 얻을 수 있습니다. 또한 postLayout 대신에 load 이벤트를 사용하고 있습니다. 바라기를 이것은 누군가를 돕기를 바랍니다.
$.map.image = 'http://getyourownimage.com/dev/8fac94c6-872b-4bda-a56a-7dba09188c66.png';
$.map.zIndex = 1;
$.map.width = 'auto';
$.map.height = 'auto';
$.map.addEventListener('load',function(e){
var rect = $.map.getRect();
Ti.API.info(rect.width); //actual width of imageView
Ti.API.info(rect.height); //actual height of imageView
Ti.API.info($.map.getWidth()); //returns auto/SIZE, doesn't work
Ti.API.info($.map.getHeight()); //returns auto/SIZE, doesn't work
Ti.API.info($.map.toImage().width); //some scaled value, not useful
Ti.API.info($.map.toImage().height); //some scaled value, not useful
Ti.API.info($.map.toBlob().width); //image original/full size width
Ti.API.info($.map.toBlob().height); //image original/full size height
alert('rectX:'+rect.width+',rectY:'+rect.height+',mapGW:'+$.map.getWidth()+',mapGH:'+$.map.getHeight()+',tiX:'+$.map.toImage().width+',tiY:'+$.map.toImage().height+',tbX:'+$.map.toBlob().width+',tbY:'+$.map.toBlob().height);
});
sdk 버전 2.1.1.GA에서 작동하지 않습니다. –