setBounds图片宽度100%

时间:2014-04-03 13:57:42

标签: android image width setbounds

我可以将全宽度照片设置为textView

抱歉,我不能说英语

我的代码:

   public class ImageGetter implements Html.ImageGetter {
    @Override
    public Drawable getDrawable(String source) {
        Drawable drawable = getResources().getDrawable(R.drawable.imgN);
        if (source.equals("img1")) {
            drawable = getResources().getDrawable(R.drawable.img1);
                drawable.setBounds(0, 0, 100, 150);
        return drawable;
    }
}

宽度= 100% drawable.setBounds(0,0,width,height);

0 个答案:

没有答案