Search code examples
c#androidioswindows-phonexamarin.forms

Responsive grid in Xamarin.forms


Referring to my previous question, I need some help making the listview items responsive on all the platform, all the sizes and also on landscape and portrait mode. The listview which I have now becomes tiny on a 10" screen. I would like to make it responsive. Any reference to achieve this?


Solution

  • It sounds like you have some kind of fixed width issue perhaps if your ListView is small and not covering the entire page?

    On your mainList you are setting to the ContentPage without any layout options.

    Try setting the HorizontalOptions and VerticalOptions of the outer element first, and once you get that working, focus on the inner controls to ensure they take up the desired amount of space afterwards.

            o.HorizontalOptions = LayoutOptions.FillAndExpand;
            o.VerticalOptions = LayoutOptions.FillAndExpand;
    

    Change the ListView BackgroundColor to some noticeable color to help you ensuring that things are laying out correctly.