Thursday, July 7, 2011

Re: [android-developers] rounded corner // Shape Drawable (via xml) vs. PNG

On Thu, Jul 7, 2011 at 11:58 AM, Ralph Bergmann <ralph@dasralph.de> wrote:
> My question: Why he/she recommends a shape drawable xml file and not a
> png file (9-patch)? Why is a shape drawable better?

A ShapeDrawable is neither better nor worse than a nine-patch PNG, any
more than a hammer is better or worse than a wrench. They are two
tools that can be used in the same places sometimes.

ShapeDrawable is great for simple shapes when the developer is not a
Photoshop expert. ShapeDrawable is excellent for resizeable simple
shapes with gradient fills, for which a nine-patch PNG is unsuitable.

A nine-patch PNG has far richer possibilities, as you are not limited
to the handful of elements and attributes of the ShapeDrawable XML
syntax.

Use whichever you like.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment