public static class CoordinatorLayout.LayoutParams
extends ViewGroup.MarginLayoutParams
java.lang.Object | |||
↳ | android.view.ViewGroup.LayoutParams | ||
↳ | android.view.ViewGroup.MarginLayoutParams | ||
↳ | android.support.design.widget.CoordinatorLayout.LayoutParams |
描述 CoordinatorLayout
的孩子所需布局的参数。
Inherited XML attributes |
|
---|---|
From class android.view.ViewGroup.MarginLayoutParams
|
|
From class android.view.ViewGroup.LayoutParams
|
Inherited constants |
---|
From class android.view.ViewGroup.LayoutParams
|
Fields |
|
---|---|
public int |
anchorGravity |
public int |
gravity
|
public int |
keyline 指定给父级CoordinatorLayout的水平keyline的索引,该子级应与之对齐。 |
Inherited fields |
---|
From class android.view.ViewGroup.MarginLayoutParams
|
From class android.view.ViewGroup.LayoutParams
|
Public constructors |
|
---|---|
CoordinatorLayout.LayoutParams(int width, int height) |
|
CoordinatorLayout.LayoutParams(CoordinatorLayout.LayoutParams p) |
|
CoordinatorLayout.LayoutParams(ViewGroup.MarginLayoutParams p) |
|
CoordinatorLayout.LayoutParams(ViewGroup.LayoutParams p) |
Public methods |
|
---|---|
int |
getAnchorId() 获取此视图的锚点的ID。 |
Behavior |
getBehavior() 获取控制父级CoordinatorLayout内子视图布局和交互的行为。 |
void |
setAnchorId(int id) 设置此视图的锚点的ID。 |
void |
setBehavior(Behavior behavior) 设置父级CoordinatorLayout中控制子视图布局和交互的行为。 |
Inherited methods |
|
---|---|
From class android.view.ViewGroup.MarginLayoutParams
|
|
From class android.view.ViewGroup.LayoutParams
|
|
From class java.lang.Object
|
CoordinatorLayout.LayoutParams (int width, int height)
Parameters | |
---|---|
width |
int
|
height |
int
|
CoordinatorLayout.LayoutParams (CoordinatorLayout.LayoutParams p)
Parameters | |
---|---|
p |
CoordinatorLayout.LayoutParams
|
CoordinatorLayout.LayoutParams (ViewGroup.MarginLayoutParams p)
Parameters | |
---|---|
p |
ViewGroup.MarginLayoutParams
|
CoordinatorLayout.LayoutParams (ViewGroup.LayoutParams p)
Parameters | |
---|---|
p |
ViewGroup.LayoutParams
|
Behavior getBehavior ()
获取控制父级CoordinatorLayout内子视图布局和交互的行为。
Returns | |
---|---|
Behavior |
The current behavior or null if no behavior is specified |
void setAnchorId (int id)
设置此视图的锚点的ID。
带有此ID的视图必须是包含此LayoutParams所属的子视图的CoordinatorLayout的后代。 它可能不是具有此LayoutParams的子视图或它的后代。
Parameters | |
---|---|
id |
int : The view id of the anchor or NO_ID if there is no anchor |
void setBehavior (Behavior behavior)
设置父级CoordinatorLayout中控制子视图布局和交互的行为。
设置新行为将删除当前关联的 Behavior tag
。
Parameters | |
---|---|
behavior |
Behavior : The behavior to set or null for no special behavior |