Calling setCompoundDrawables() doesn't display the Compound Drawable

后端 未结 10 1018
自闭症患者
自闭症患者 2020-12-04 06:58

After I call the setCompoundDrawables method, the compound Drawable is not shown..

Drawable myDrawable = getResources().getDrawable(R.drawable.btn);
btn.setC         


        
10条回答
  •  爱一瞬间的悲伤
    2020-12-04 07:50

    Example set to the top:

    view.setCompoundDrawablesWithIntrinsicBounds(
        null,
        getResources().getDrawable(R.drawable.some_img),
        null,
        null
    );
    

    arguments order: (left, top, right, bottom)

提交回复
热议问题