I've created some UICollectionViewCells which I'd like to place inside a UICollectionView with the option for the user to set the size of the items in the view (between 100% and 50% so they can see more UIViews at the same time).
So I've added a function like so:
[Export("collectionView:layout:sizeForItemAtIndexPath:")]
public CGSize GetSizeForItem(UICollectionView collectionView, UICollectionViewLayout layout, NSIndexPath indexPath)
{
return new CGSize {
Width = 243.0f,
Height = 209.7f
};
}
Where 243.0f/209.7f is the size of the UICollectionViewCell.
My particular instance of UICollectionViewCell has a few text fields and things inside of it, so setting a smaller CG size (i.e. *0.5) causes a few text issues.
I've found that using scaling with CGAffineTransform leads to a desirable result however when I apply the scale to the individual child views it doesn't carry over to the UICollectionView for alignment (which makes sense).
Is there a way around this where I can use transform scaling to achieve my desired result?
I'm thinking maybe I should create a container like UICollectionViewCell where its child is the actual view I want to display, then set its size inversely to the parents size and apply scale to achieve the correct result...