你必须等img加载完成才能取到img的宽度和高度用MediaTracker MediaTracker tracker = new MediaTracker(this);
tracker.addImage(img, 0); try{
tracker.waitForID(0);
}catch(Exception e){} img.getWidth(null);
img.getHeight(null);
tracker.addImage(img, 0); try{
tracker.waitForID(0);
}catch(Exception e){} img.getWidth(null);
img.getHeight(null);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货