Android - set layout background programmatically

后端 未结 3 1385
旧巷少年郎
旧巷少年郎 2020-12-09 21:04

I have noticed that the setBackground method for the RelativeLayout object is targeted for API 16 (Android 4.1) and higher, but my application has the targ

3条回答
  •  余生分开走
    2020-12-09 21:50

    Use setBackgroundDrawable() instead. It does the same thing, but it's been deprecated since the new setBackground() method.

提交回复
热议问题