RecyclerView原生的LayoutManager并不能自适应宽高,此处实现了一个LayoutManager的子类,实现了自适应。
留作备份。
/**
* Created by Harlan on 2015/8/20 0020.
*/
public class SyLinearLayoutManager extends LinearLayoutManager {
private static final int CHILD_WIDTH = 0;
private static final int CHILD_HEIGHT = 1;
private static final int DEFAULT_CHILD_SIZE = 100;
private final int[] childDimensions = new int[2];
private int childSize = DEFAULT_CHILD_SIZE;
private boolean hasChildSize;