简体   繁体   中英

Xamarin.Forms > List > Custom Renderer

Is it possible to write a custom renderer for the Xamarin.Forms List, that renders two rows next to each other, so basically like a bound grid view

-------------
Item1 | Item2
-----------
Item3 | Item4
-------------
Item5 ...

Thanks, Nikolai

You don't need to use custom renderers in Xamarin.Forms. You can use the GridView component in Xamarin Forms XLabs . Setting MaxColumns as 2 will render 2 columns in a row

<ctrl:GridView 
 HorizontalOptions="FillAndExpand"
  VerticalOptions="FillAndExpand"
  x:Name="GrdView" RowSpacing="5"
  ColumnSpacing="5" MaxColumns="2"
  TileHeight="120"
   CommandParameter="{Binding}"
   Command="{Binding StartTaskCommand}"
   IsClippedToBounds="False">
  </ctrl:GridView>

Here is a tutorial on how to use that .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM