android - 9-patch bitmap on a widget using RemoteViews -
I have a widget with an image view on it I set this imageview in bitmap created with 9-patch PNG resource Have done The image is set properly but does not spread correctly - that is, my image spreads like a 9-patch defined in PNG. If I set the 9-patch image as a resource, then it works. How can I fix this?
// does not work (9-patch is not displayed correctly) bitmap bitmap = bitmapfactory.d decodeResource (context.getResources (), R.drawable.SomeNinePatch); RemoteViews.setImageViewBitmap (R.id.someImageView, Bitmap); // Works (9-displays patch correctly) Remote visualization. Image Image Resource (RID.IMAViewview, ArdoubableomNominipatch);
Android knows that a PNG is a nine patch, based on 9. PNG file extension on the resource. I do not know in any way to use nine patch images out of resources, because Android will not have a file extension and will not know that the image is nine patch.
Comments
Post a Comment