[android-developers] Custom LayoutParams

2011-09-11 Thread Zsolt Vasvari
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

Re: [android-developers] Custom LayoutParams

2011-09-11 Thread Romain Guy
You need to override the method generateLayoutParams(): http://developer.android.com/reference/android/view/ViewGroup.html#generateLayoutParams(android.util.AttributeSet) and checkLayoutParams():

[android-developers] Custom LayoutParams?

2008-09-01 Thread Erik Calissendorff
Hi, I have created a custom ViewGroup and would like to have a custom LayoutParams together with it so I can assign these to the children through the XML. I have created a custom LayoutParams class and added the following to my attrs.xml: declare-styleable name=LayoutParams attr