private void LoadChapterView() { if (chapterList != null && chapterList.Count > 0) { // collectionView InitializeCollectionView(typeof(ChapterCell), "chapterCell"); // flowLayout collectionView.CollectionViewLayout = new DashboardLayout() { ItemSize = new CGSize(220, 388.33f) }; // dataSource DashboardDataSource dataSource = new DashboardDataSource(book, chapterList as Object, DashboardDataSource.DataType.CHAPTERS, "chapterCell"); dataSource.ItemPressedEvent += HandleChapterPressedEvent; collectionView.Source = dataSource; collectionView.ReloadData(); collectionView.LayoutIfNeeded(); ShowHideChapterStatus(false); } else { ShowHideChapterStatus(true); } }
protected void ResizeView() { tagsCollectionView.LayoutIfNeeded(); var collectionContentSize = tagsCollectionView.ContentSize; tagsCollectionHeight.Constant = collectionContentSize.Height; }
public virtual nfloat GetCellHeightRelativeToCollectionViewHeight(UICollectionView collectionView, nfloat cellsDisplayedOnScreenDownCollectionView) { collectionView.SetNeedsLayout( ); collectionView.LayoutIfNeeded( ); nfloat totalCellSpacingSizeDisplayed = ( nfloat )Math.Floor(cellsDisplayedOnScreenDownCollectionView) * CellSpacing; nfloat cellHeight = (collectionView.Bounds.Height - ContentInset.Top - totalCellSpacingSizeDisplayed) / cellsDisplayedOnScreenDownCollectionView; return(cellHeight); }
public virtual nfloat GetCellWidthRelativeToCollectionViewWidth(UICollectionView collectionView, nfloat cellsDisplayedOnScreenAcrossCollectionView) { collectionView.SetNeedsLayout( ); collectionView.LayoutIfNeeded( ); nfloat totalCellSpacingSizeDisplayed = ( nfloat )Math.Floor(cellsDisplayedOnScreenAcrossCollectionView) * CellSpacing; nfloat cellWidth = (collectionView.Bounds.Width - ContentInset.Left - totalCellSpacingSizeDisplayed) / cellsDisplayedOnScreenAcrossCollectionView; return(cellWidth); }