Custom LayoutParams

Showing 1-3 of 3 messages
Custom LayoutParams Zsolt Vasvari 9/11/11 7:29 PM
I created my own Layout, let's callit MyLayout and the corresponding
LayoutParams class:  MyLayout.LayoutParams.

But when I am inflating my view from XML, it creates the child views
using ViewGroup.LayoutParams instead of MyLayout.LayoutParams.
Obviously, I am missing something in the XML definition where I tie my
MyLayout.LayoutParams to MyLayout.

Anyboyd knows what I am doing wrong here?
Re: [android-developers] Custom LayoutParams Romain Guy 9/11/11 7:35 PM
You need to override the method generateLayoutParams(): http://developer.android.com/reference/android/view/ViewGroup.html#generateLayoutParams(android.util.AttributeSet)
and checkLayoutParams():
and generateDefaultLayoutParams():




--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-d...@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



--
Romain Guy
Android framework engineer
roma...@android.com

Re: Custom LayoutParams Zsolt Vasvari 9/11/11 8:23 PM
Ok, thanks.  I've was missing generateLayoutParams(), had the other 2.



On Sep 12, 10:35 am, Romain Guy <romain...@android.com> wrote:
> You need to override the method generateLayoutParams():http://developer.android.com/reference/android/view/ViewGroup.html#ge...)
> and checkLayoutParams():http://developer.android.com/reference/android/view/ViewGroup.html#ch...)
> and generateDefaultLayoutParams():http://developer.android.com/reference/android/view/ViewGroup.html#ge...()
>
>
>
>
>
> On Sun, Sep 11, 2011 at 7:29 PM, Zsolt Vasvari <zvasv...@gmail.com> wrote:
> > I created my own Layout, let's callit MyLayout and the corresponding
> > LayoutParams class:  MyLayout.LayoutParams.
>
> > But when I am inflating my view from XML, it creates the child views
> > using ViewGroup.LayoutParams instead of MyLayout.LayoutParams.
> > Obviously, I am missing something in the XML definition where I tie my
> > MyLayout.LayoutParams to MyLayout.
>
> > Anyboyd knows what I am doing wrong here?
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-d...@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
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com- Hide quoted text -
>
> - Show quoted text -