You need to override the method generateLayoutParams(): http://developer.android.com/reference/android/view/ViewGroup.html#generateLayoutParams(android.util.AttributeSet) and checkLayoutParams(): http://developer.android.com/reference/android/view/ViewGroup.html#checkLayoutParams(android.view.ViewGroup.LayoutParams) and generateDefaultLayoutParams(): http://developer.android.com/reference/android/view/ViewGroup.html#generateDefaultLayoutParams()
On Sun, Sep 11, 2011 at 7:29 PM, Zsolt Vasvari <[email protected]> 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 [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 > -- Romain Guy Android framework engineer [email protected] -- 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

