【发布时间】:2012-07-20 14:23:22
【问题描述】:
我使用钛。我使用 Android Nexus S 进行测试。
我有一个来自画廊的照片。我找不到获取这张照片的宽度和高度的方法。
我已经看到了一些关于 auto 属性的提示,但是这个提示似乎没有运行 因为钛 2.0。
第一次尝试
Ti.Media.openPhotoGallery({
success : function(e) {
alert(e.media.width + " x " + e.media.height);
}});
结果“0 x 0”
第二次尝试
Ti.Media.openPhotoGallery({
success : function(e) {
var img = Ti.UI.createImageView({
image : e.media,
width: 'auto',
height: 'auto' });
alert(img.width + " x " + img.height);
}});
结果“自动 x 自动”
所以,我的简单问题:
如何获取从图库中获取的照片的尺寸?
【问题讨论】: