xamarin.ios - "GetSizeForItem" for a UICollectionView in Xamarin with UICollectionViewFlowLayout does not get called -


i have uiviewcontroller has uicollectionview added subview in viewdidload. using uicollectionviewflowlayout , have created custom mvxcollectionviewsource manage cells.

i provide cell information in constructor of layout object not make flexible device , orientation changes.

uicollectionviewlayout layout = new uicollectionviewflowlayout () {itemsize = new sizef (354, 150),             scrolldirection = uicollectionviewscrolldirection.vertical         }; 

allocating uicollectionview in viewdidload method.

collectionview = new uicollectionview (this.view.bounds, layout);         collectionview.delegate = new customviewdelegate();         collectionview.registerclassforcell (typeof(projectcollectioncell), projectcollectioncell.key);         collectionview.source = new projectcollectionsource (collectionview, this,projectcollectioncell.key);         collectionview.backgroundcolor = uicolor.clear;         //          collectionview.registerclassforsupplementaryview (typeof(header), uicollectionelementkindsection.header, headerid);         collectionview.allowsmultipleselection = true;         this.view.addsubview (collectionview); 

now projectcollectionsource custom source , have created uicollectionviewdelegateflowlayout mentioned here.

the uicollectionviewdelegateflowlayout below never gets called.

class customviewdelegate: uicollectionviewdelegateflowlayout     {          public override coregraphics.cgsize getsizeforitem (uicollectionview collectionview, uicollectionviewlayout layout, nsindexpath indexpath)         {             return new coregraphics.cgsize (100, 100);         }     } 


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

c# - Retrieve google contact -

javascript - How to insert selected radio button value into table cell -