Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/andreinitescu/GridSplitterApp

GridSplitter control for Xamarin.Forms
https://github.com/andreinitescu/GridSplitterApp

Last synced: 29 days ago
JSON representation

GridSplitter control for Xamarin.Forms

Awesome Lists containing this project

README

        

GridSplitter control for Xamarin Forms
===================

A control for Xamarin Forms that redistributes space between columns or rows of a Grid control.

Platforms supported: iOS, Android, WinPhone

Usage
-------

An example of a Grid with two rows and a GridSplitter control:













Note that `` tells the GridSplitter control it should resize the adjancent rows.

And here's the result on iOS for the XAML above:

![iOS screenshot](mGkd879Oqv.gif)

Also note the `RowSpacing=0` which resets the default spacing between the cells of Grid. You might want to set this on your Grid when using the GridSplitter, otherwise it won't look good.

If you would have to split two columns instead, you need to set `HorizontalOptions="Center"` on the GridSplitter:













Another example of two Grid controls each with their own GridSplitter:

![iOS screenshot](DnaXEi1wzw.gif)

The XAML for this layout is included in the sample app: [/GridSplitterApp/GridSplitterApp/MainPage.xaml)](/GridSplitterApp/GridSplitterApp/MainPage.xaml)
It also shows how you can easily change the style of the GridSplitter control.

Add GridSplitter to your project
-----------------------

1. Add GridSplitter control implementation to your Xamarin Forms PCL project:
[/GridSplitterApp/GridSplitterApp/Controls/GridSplitter.cs](/GridSplitterApp/GridSplitterApp/Controls/GridSplitter.cs)

2. The control uses native renderes. You need to add the renderers to your Android and iOS project respectively:
[/GridSplitterApp/GridSplitterApp.Droid/Renderers/GridSplitterRenderer.cs](/GridSplitterApp/GridSplitterApp.Droid/Renderers/GridSplitterRenderer.cs)
[/GridSplitterApp/GridSplitterApp.iOS/Renderer/GridSplitterRenderer.cs](/GridSplitterApp/GridSplitterApp.iOS/Renderer/GridSplitterRenderer.cs)

Note you might need to update some namespaces in your app.