Thursday, July 14, 2011

[android-developers] Re: How to delegate layout in an abstract ViewGroup

O god, ViewStub is declared final.
Why???????????????????
I can't extend it.
How do I reuse it?

On Jul 13, 7:14 pm, Tapomay Dey <tapomay....@gmail.com> wrote:
> Thanks for the ViewStub approach.
>
> On Jul 13, 6:08 pm, Kostya Vasilyev <kmans...@gmail.com> wrote:
>
> > Yeah, why not?
>
> > Presumably, you have some logic in the code that knows the type of UI
> > it's building.
>
> > Add a ViewGroup to your layout with a known id, and have the code
> > inflate the actual layout, then add it to the view group.
>
> > Another option is to use ViewStubs in the parent layout, and call
> > inflate / show on just the needed stub. This will let you specify the
> > actual layout in the XML. Once a ViewStub is inflated / shown, it
> > removes itself from the view hierarchy, replacing itself with the
> > inflated layout.
>
> > -- Kostya
>
> > 13.07.2011 16:42, Tapomay Dey пишет:
>
> > > Following could be a solution:
> > > In the setter method for layout resourceID, inflate the layout and add
> > > it as child to the "this" View object.
> > > Is this a clean approach?
>
> > > Regards,
> > > Tapomay.
>
> > --
> > Kostya Vasilyev

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