I have two relative layouts. Both have width of fill parent and height of 100 dip. My requirement is when I click the first layout it should shrink to 50dip height and the o
These supply parameters to the parent of this view specifying how it should be arranged. There are many subclasses of ViewGroup.LayoutParams
and these correspond to the different subclasses of ViewGroup
that are responsible for arranging their children.
So basically, if you are adding a view to another, you MUST set the LayoutParams
of the view to the LayoutParams
type that the parent uses or you will get a runtime error.