How to get the attr reference in code?

前端 未结 2 875
逝去的感伤
逝去的感伤 2020-12-04 15:14

I\'m looking to get the pointing reference from an attribute via code. In my xml layouts I can easily get the referenced drawable like this:

android:backgrou         


        
2条回答
  •  难免孤独
    2020-12-04 16:02

    Shouldn't you use:

    android:background="@drawable/listItemBackground"

    And then:

    myImageButton.getBackgroundDrawable()

    Or maybe I didn't understand ...

提交回复
热议问题