0

I would like to create a Masonry (or Staggered Grid) effect with Xamarin.Forms like the following image (source of image https://masonry.desandro.com/) that works for both iOS and Android enter image description here

Salvo
  • 169
  • 1
  • 1
  • 14

1 Answers1

0

According to your description, you want to use one control like wrappanel in WPF, am I right? If yes, I suggest you can follow these steps to do.

1.create Wraplayout class, inherit Layout in PCL.you can take a look:

https://github.com/conceptdev/xamarin-forms-samples/blob/master/Evolve13/Evolve13/Controls/WrapLayout.cs

2.Using this Wraplayout.

<xf:WrapLayout>
        <Button Text="Button A" />
        <Button Text="Button B" WidthRequest="250" />
        <Button Text="Button C" WidthRequest="150" />
        <Button Text="Button D" />
        <Button Text="Button E" WidthRequest="200" />


    </xf:WrapLayout>
Cherry Bu - MSFT
  • 10,160
  • 1
  • 10
  • 16
  • I'm sorry, but this answer is not the solution to my problem – Salvo Sep 23 '19 at 13:58
  • @Salvo,According to your screenshot, do you want to use one control like wrappanel in wpf? – Cherry Bu - MSFT Sep 24 '19 at 09:31
  • No, I would like to create a Masonry effect in two columns as in this link https://codepen.io/chriscoyier/pen/pqEgBV It is not the width of the elements that gives me problems, but their height and the "interlocking" anchor – Salvo Sep 24 '19 at 10:22
  • @Salvo, II haven't found a better way to do it yet, like Masonry effect, if you have way to do this, please share here. – Cherry Bu - MSFT Sep 27 '19 at 08:05