本帖最后由 zhoudianlong 于 2011-09-20 11:37:46 编辑

解决方案 »

  1.   

    drawable的方法转换成int的方法??  drawable不就是通过int代表的资源图片才或得的吗?为什么要去转换?int的在资源文件里面找就可以。这个是android源代码里面google search的代码:
    Drawable googlePlaceholder = getContext().getResources().getDrawabl(R.drawable.placeholder_google);
      

  2.   

    setCompoundDrawablesWithIntrinsicBounds(int left, int top, int right, int bottom) {
        final Resources resources = getContext().getResources();
        setCompoundDrawablesWithIntrinsicBounds(left != 0 ? resources.getDrawable(left) : null,
                    top != 0 ? resources.getDrawable(top) : null,
                    right != 0 ? resources.getDrawable(right) : null,
                    bottom != 0 ? resources.getDrawable(bottom) : null);
    }
    应该没有区别,看上面的源码就知道,整型参数的方法还是调用了drawable参数的那个方法,里面还是根据resID获取到了drawable。
    可能你传进去的drawable大小就不对。