UICollectionViewCompositionalLayout.GetLayout(config); always returns null

Curtis Conner 1 Reputation point
2022-06-06T06:16:30.697+00:00

Hi,

I am trying to implement the ipados sidebar code with the new .net 6 core ios and the below code always returns null

    public override void ViewDidLoad()
    {
        base.ViewDidLoad();

        var config = new UICollectionLayoutListConfiguration(UICollectionLayoutListAppearance.Sidebar);
        config.HeaderMode = UICollectionLayoutListHeaderMode.None;
        config.HeaderMode = UICollectionLayoutListHeaderMode.FirstItemInSection;


        var layout = UICollectionViewCompositionalLayout.GetLayout(config); // <--- this will always return null, why?
   }
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,926 questions
{count} votes