OGeek|极客世界-中国程序员成长平台

标题: android - 调用 setCompoundDrawables() 不会显示 Compound Drawable [打印本页]

作者: 菜鸟教程小白    时间: 2022-8-1 01:19
标题: android - 调用 setCompoundDrawables() 不会显示 Compound Drawable

在我调用 setCompoundDrawables 之后方法,复合 Drawable 没有显示..

Drawable myDrawable = getResources().getDrawable(R.drawable.btn);
btn.setCompoundDrawables(myDrawable, null, null, null);

有什么想法吗?



Best Answer-推荐答案


我需要使用 setCompoundDrawablesWithIntrinsicBounds .

关于android - 调用 setCompoundDrawables() 不会显示 Compound Drawable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6590838/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://jike.in/) Powered by Discuz! X3.4