Android: Changing LinearLayout in a widget

后端 未结 2 1074
逝去的感伤
逝去的感伤 2021-01-16 17:12

I have this really annoying problem:

In my widget, i would like to change the background by code. I noticed on the Google doc than I can easily change the background

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-16 17:33

    You cannot modify the background that way, due to limitations in the RemoteViews API.

    What you can do is choose a different layout -- one with the background you want -- when you create your RemoteViews instance for this particular update.

提交回复
热议问题