您的位置首页生活百科

LinearLayout.LayoutParams 是什么意思 在列表的控件中

LinearLayout.LayoutParams 是什么意思 在列表的控件中

的有关信息介绍如下:

LinearLayout.LayoutParams 是什么意思 在列表的控件中

来自官网的解释http://developer.android.com/reference/android/widget/LinearLayout.LayoutParams.html 概述:Per-child layout information associated with ViewLinearLayout.继承关系:java.lang.Object ↳ android.view.ViewGroup.LayoutParams ↳ android.view.ViewGroup.MarginLayoutParams ↳ android.widget.LinearLayout.LayoutParams从官网中可以看出,其实这个LayoutParams类是用于child view(子视图) 向 parent view(父视图)传达自己的意愿的一个东西(孩子想变成什么样向其父亲说明)其实子视图父视图可以简单理解成一个LinearLayout 和 这个LinearLayout里边一个 TextView 的关系 TextView 就算LinearLayout的子视图 child view 。需要注意的是LayoutParams只是ViewGroup的一个内部类这里边这个也就是ViewGroup里边这个LayoutParams类是 base class 基类实际上每个不同的ViewGroup都有自己的LayoutParams子类