Every ViewGroup
class implements a nested class that extends ViewGroup.LayoutParams
. So we LinearLayout.LayoutParams
, RelativeLayout.LayoutParams
, FrameLayout.LayoutParams
etc.
Suppose I want to create a View
, e.g. TextView
programmatically. I will have to give it the required properties, like layout_width
and layout_height
, for which I will have to use a LayoutParams
class. How will I know which LayoutParams
class to use?