Is there such a method call “getBackgroundColor”?

前端 未结 6 1826
旧巷少年郎
旧巷少年郎 2021-01-17 07:29

Is there such a method call \"getBackgroundColor\" in TextView? if I got 2 textViews: tv1 and tv2 in one LinearLayout. What I did:tv1.setBackgroundColor(Color.BLUE)

6条回答
  •  死守一世寂寞
    2021-01-17 08:22

    There is no such method, because in common there is now "background color" - there can be any Drawable object(for example picture). So, you should remember what color do you set for text.

    If you can't save it - use View.setTag() and View.getTag() methods to store any value, associated with view.

提交回复
热议问题