0
我想知道是否有辦法,我可以定製的Android gridlayoutmanager
有水平佈局這樣的草圖: GridLayoutManager定製
我嘗試了一些佈局管理他們的,我在Github上找到,但不認爲幫助我執行這種佈局管理器。
是這樣的:
public class CustomLayoutManager extends StaggeredGridLayoutManager {
public CustomLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
public CustomLayoutManager(int spanCount, int orientation) {
super(spanCount, orientation);
}
@Override
public void onMeasure(RecyclerView.Recycler recycler, RecyclerView.State state, int widthSpec, int heightSpec) {
super.onMeasure(recycler, state, widthSpec, heightSpec);
}
@Override
public void setSpanCount(int spanCount) {
super.setSpanCount(spanCount);
}}
任何幫助將不勝感激 感謝
您可以在適配器中使用多種類型的佈局。 –
我無法更改適配器設置。它是在Android電視環境 – destrat18
如果我的答案幫助你,請將其標記爲已接受。 :) –