Why does 9-patch does not work on wallpapers?
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
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.
精彩评论