How to set property “android:drawableTop” of a button at runtime

前端 未结 8 1061
名媛妹妹
名媛妹妹 2020-12-04 21:01

How to set property \"android:drawableTop\" of a button at runtime

8条回答
  •  悲&欢浪女
    2020-12-04 21:26

    Drawable top = getResources().getDrawable(R.drawable.image);
    button.setCompoundDrawablesWithIntrinsicBounds(null, top , null, null);
    

提交回复
热议问题