0

I had a small image 250x208 (size decreased from 960x800) and made 9.png out of it. Set it as a wallpaper image via wallpaperManager.setResource(R.drawable.my_wallpaper); but it is still getting stretched incorrectly like this is not 9-patch image.

Why 9-patch does not size correctly as a wallpaper?

What do you do when you have an app that has to set some image as a wallpaper?

Thanks in advance

sandalone
  • 41,141
  • 63
  • 222
  • 338

1 Answers1

2

I don't believe that WallpaperManager supports nine-patches, so you may need to render the nine-patch yourself using a live wallpaper.


EDIT: removed since the question was changed.

You should just use a View with an android:background set to the nine-patch. There's no need to use an ImageView with all its fancy custom image scaling logic for a background image.

Roman Nurik
  • 29,665
  • 7
  • 84
  • 82