Thank you Calin, Button.getBackground() instanceof NinePatchDrawable returns me a true.
Sorry for the confusion. I mean the return value of *"AndroidStandartButton" *.getBackground() whichs background is created by the NinePatch PNG offered *private* by the Android System. My actual problem is a ListView with 3 rows and in every row are four Buttons in a own View. the Buttons have different lengths and refer all to one NinePatch drawable. if i change the background drawable at of one button (for highlightling) the other Buttons Background drawable lengh shrinks to the one of the chosen button... horrible. Am Donnerstag, 13. September 2012 08:42:07 UTC+2 schrieb Calin Perebiceanu: > > Hello, > > If you are referring to Button.getBackground() than it returns Drawable > http://developer.android.com/reference/android/graphics/drawable/Drawable.html > > , which is the base class for * > BitmapDrawable<http://developer.android.com/reference/android/graphics/drawable/BitmapDrawable.html> > *, > ClipDrawable<http://developer.android.com/reference/android/graphics/drawable/ClipDrawable.html> > , > ColorDrawable<http://developer.android.com/reference/android/graphics/drawable/ColorDrawable.html> > , > DrawableContainer<http://developer.android.com/reference/android/graphics/drawable/DrawableContainer.html> > , > GradientDrawable<http://developer.android.com/reference/android/graphics/drawable/GradientDrawable.html> > , > InsetDrawable<http://developer.android.com/reference/android/graphics/drawable/InsetDrawable.html> > , > LayerDrawable<http://developer.android.com/reference/android/graphics/drawable/LayerDrawable.html> > , > *NinePatchDrawable*<http://developer.android.com/reference/android/graphics/drawable/NinePatchDrawable.html> > , > PictureDrawable<http://developer.android.com/reference/android/graphics/drawable/PictureDrawable.html> > ,RotateDrawable<http://developer.android.com/reference/android/graphics/drawable/RotateDrawable.html> > , > ScaleDrawable<http://developer.android.com/reference/android/graphics/drawable/ScaleDrawable.html> > , > ShapeDrawable<http://developer.android.com/reference/android/graphics/drawable/ShapeDrawable.html> > . > So I guess you can test with instanceof. > > The second thing I read in your post and confused me is "AndroidOS > specific nine-patch drawable?". Android doesn't convert a png to a 9.png. > Whatever resource you provide (.png or .9.png) that is what Android uses. > > On Thursday, 13 September 2012 08:40:42 UTC+3, superpsycho wrote: >> >> Does "Button.getBackgroundDrawable()" on a original Android button give >> me a normal drawable or the AndroidOS specific nine-patch drawable? - Or >> how can i test it by my self cause I think any method to display a drawable >> hints the nine-patch elements at the sides... Thx for all the helpful rplyZ. >> >> Good morning from Germany, and stay tuned, this will become a gorgeous >> day! >> > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

