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
如果我的答案帮助你,请将其标记为已接受。 :) –