Using Layout resources in a LiveWallpaper on Android

后端 未结 2 1947
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-09 23:41

When you create a LiveWallpaper in Android 2.2+ you get a canvas (or whatever the 3D equivalent is) to draw on. I\'d like to draw some elements using the built-in Android UI too

2条回答
  •  粉色の甜心
    2021-02-10 00:05

    Live Wallpapers were very specifically designed to NOT use standard UI widgets. However it is possible to use them anyway. You will have to force a layout pass yourself by first calling measure() on the View, then layout(). You can find more information in my presentation.

提交回复
热议问题