protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec) { base.OnMeasure(widthMeasureSpec, heightMeasureSpec); IListAdapter adapter = Adapter; HeaderViewGridAdapter gridAdapter = adapter as HeaderViewGridAdapter; if (gridAdapter != null) { gridAdapter.SetNumColumns(GetNumColumnsCompat()); } }
public override void SetAdapter(IListAdapter adapter) { if (_mHeaderViewInfos.Any()) { HeaderViewGridAdapter headerViewGridAdapter = new HeaderViewGridAdapter(_mHeaderViewInfos, _mFooterViewInfos, adapter); int numColumns = GetNumColumnsCompat(); if (1 < numColumns) { headerViewGridAdapter.SetNumColumns(numColumns); } base.SetAdapter(headerViewGridAdapter); } else { base.SetAdapter(adapter); } }
public override void SetAdapter(IListAdapter adapter) { if (_mHeaderViewInfos.Any()) { HeaderViewGridAdapter headerViewGridAdapter = new HeaderViewGridAdapter(_mHeaderViewInfos, _mFooterViewInfos, adapter); int numColumns = GetNumColumnsCompat(); if (1 < numColumns) { headerViewGridAdapter.SetNumColumns(numColumns); } base.SetAdapter(headerViewGridAdapter); } else { base.SetAdapter(adapter); } }