Monday, July 30, 2012

Re: [android-developers] Set bounds for one layer of LayerDrawable?

Thanks Dianne for your input. I've been working on a two drawable solution since earlier today. My motivation for using LayerDrawable was to model Android's ProgressBar, where the layer with id=android:id/progress is either a ClipDrawable or a ScaleDrawable (depending on API level). 

Thus far with ScaleDrawable and ClipDrawable, I've only seen ways to set gravity, whereas I need finer control of the region being drawn. Is there some way to accomplish what I'm after using either of those classes?

On Monday, July 30, 2012 6:00:23 PM UTC-7, Dianne Hackborn wrote:
No, the bounds are where the drawable will actually render itself.  If you want two different bounds, that should technically be two different drawables.

If you need to have this all in one drawable, the only option I can think of is to make your own subclass of Drawable that computes the different bounds as you want them.

--
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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate