Skip to content

Instantly share code, notes, and snippets.

@Arpit360
Created February 4, 2015 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Arpit360/527c6d340daf2d6b2368 to your computer and use it in GitHub Desktop.
Save Arpit360/527c6d340daf2d6b2368 to your computer and use it in GitHub Desktop.
using System;
using Xamarin.Forms;
namespace Bug226674
{
class TableViewFormDemoPage : ContentPage
{
public TableViewFormDemoPage()
{
Label header = new Label
{
Text = "TableView for a form",
Font = Font.SystemFontOfSize(30, FontAttributes.Bold),
HorizontalOptions = LayoutOptions.Center
};
TableView tableView = new TableView
{
Intent = TableIntent.Form,
Root = new TableRoot("TableView Title")
{
new TableSection("Table Section")
{
new TextCell
{
Text = "Text Cell",
Detail = "With Detail Text",
},
new ImageCell
{
// Some differences with loading images in initial release.
ImageSource =
Device.OnPlatform(ImageSource.FromUri(new Uri("http://xamarin.com/images/index/ide-xamarin-studio.png")),
ImageSource.FromFile("ide_xamarin_studio.png"),
ImageSource.FromFile("Images/ide-xamarin-studio.png")),
Text = "Image Cell",
Detail = "With Detail Text",
},
new SwitchCell
{
Text = "Switch Cell"
},
new EntryCell
{
Label = "Entry Cell",
Placeholder = "Type text here"
},
new ViewCell
{
View = new Label
{
Text = "A View Cell can be anything you want!"
}
}
}
}
};
// Build the page.
this.Content = new StackLayout
{
Children =
{
header,
tableView
}
};
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment