public static class StaggeredGridLayoutManager.LayoutParams
extends RecyclerView.LayoutParams
java.lang.Object | ||||
↳ | android.view.ViewGroup.LayoutParams | |||
↳ | android.view.ViewGroup.MarginLayoutParams | |||
↳ | android.support.v7.widget.RecyclerView.LayoutParams | |||
↳ | android.support.v7.widget.StaggeredGridLayoutManager.LayoutParams |
由StaggeredGridLayoutManager使用的LayoutParams。
请注意,如果方向为 VERTICAL
,宽度参数被忽略,如果方向为 HORIZONTAL
,因为子视图有望填补所有给它的空间的高度参数被忽略。
Inherited XML attributes |
|
---|---|
From class android.view.ViewGroup.MarginLayoutParams
|
|
From class android.view.ViewGroup.LayoutParams
|
Constants |
|
---|---|
int |
INVALID_SPAN_ID 尚未布置视图的跨度ID。 |
Inherited constants |
---|
From class android.view.ViewGroup.LayoutParams
|
Inherited fields |
---|
From class android.view.ViewGroup.MarginLayoutParams
|
From class android.view.ViewGroup.LayoutParams
|
Public constructors |
|
---|---|
StaggeredGridLayoutManager.LayoutParams(Context c, AttributeSet attrs) |
|
StaggeredGridLayoutManager.LayoutParams(int width, int height) |
|
StaggeredGridLayoutManager.LayoutParams(ViewGroup.MarginLayoutParams source) |
|
StaggeredGridLayoutManager.LayoutParams(ViewGroup.LayoutParams source) |
|
StaggeredGridLayoutManager.LayoutParams(RecyclerView.LayoutParams source) |
Public methods |
|
---|---|
final int |
getSpanIndex() 返回此视图分配到的跨度索引。 |
boolean |
isFullSpan() 返回此视图是否占用所有可用跨度或仅占一个。 |
void |
setFullSpan(boolean fullSpan) 设置为true时,该项目将使用所有跨度区域进行布局。 |
Inherited methods |
|
---|---|
From class android.support.v7.widget.RecyclerView.LayoutParams
|
|
From class android.view.ViewGroup.MarginLayoutParams
|
|
From class android.view.ViewGroup.LayoutParams
|
|
From class java.lang.Object
|
int INVALID_SPAN_ID
尚未布置视图的跨度ID。
常量值:-1(0xffffffff)
StaggeredGridLayoutManager.LayoutParams (Context c, AttributeSet attrs)
Parameters | |
---|---|
c |
Context
|
attrs |
AttributeSet
|
StaggeredGridLayoutManager.LayoutParams (int width, int height)
Parameters | |
---|---|
width |
int
|
height |
int
|
StaggeredGridLayoutManager.LayoutParams (ViewGroup.MarginLayoutParams source)
Parameters | |
---|---|
source |
ViewGroup.MarginLayoutParams
|
StaggeredGridLayoutManager.LayoutParams (ViewGroup.LayoutParams source)
Parameters | |
---|---|
source |
ViewGroup.LayoutParams
|
StaggeredGridLayoutManager.LayoutParams (RecyclerView.LayoutParams source)
Parameters | |
---|---|
source |
RecyclerView.LayoutParams
|
int getSpanIndex ()
返回此视图分配到的跨度索引。
Returns | |
---|---|
int |
The Span index of the View. If View is not yet assigned to any span, returns INVALID_SPAN_ID . |
boolean isFullSpan ()
返回此视图是否占用所有可用跨度或仅占一个。
Returns | |
---|---|
boolean |
True if the View occupies all spans or false otherwise. |
也可以看看:
void setFullSpan (boolean fullSpan)
设置为true时,该项目将使用所有跨度区域进行布局。 这意味着,如果方向是垂直的,视图将具有全宽; 如果方向是水平的,那么视图将具有完整的高度。
Parameters | |
---|---|
fullSpan |
boolean : True if this item should traverse all spans. |
也可以看看: