LayoutParams相当于一个Layout的信息包,它封装了Layout的位置、高、宽等信息。假设在屏幕上一块区域是由一个Layout占领的,如果将一个View添加到一个Layout中,最好告诉Layout用户期望的布局方式,也就是将一个认可的layoutParams传递进去。
使用LayoutParams 我们可以动态的构建布局。
LayoutParams继承于Android.View.ViewGroup.LayoutParams.
android.widget.RelativeLayout.LayoutParams 有一个构造函数:RelativeLayout.LayoutParams(int w, int h),