Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Items control with flow left to right, top to bottom

$
0
0

Hi,

I need to create a layout in Xaramin Forms but I am having trouble understanding how to get it done.

I need to bind a list of items to the page. the items should be displayed in 2 columns, moving left to right, then rows top to bottom.
In addition, the item template should be 'mirrored' for the right column.

I have attached an image from WP8 (quick starting a new solution). This is exactly what I want.
Is this possible in Xamarin?

I achieved this with a ListView. ItemsPanel is set as "ItemsWrapGrid" with Horizontal orientation (was looking for WrapPanel but it seems to be WPF only?)
Data Template is a StackPanel (horizontal) with Image, and another Stackpanel (vertical) with the 2x TextBlock.
I bind FlowDirection on the first stackpanel to "mirror" the columns
public FlowDirection Direction { get { return Index % 2 != 0 ? FlowDirection.LeftToRight : FlowDirection.RightToLeft; } private set { } }

Can somebody help me achieve this?
if not, alternative? I was thinking scroll panel with 2x list view for left/right bound to 2x list objects; this is not ideal (and I don't know if it will work)

Thanks for your time

Regards,
Craig


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>