-
-
Save Arpit360/527c6d340daf2d6b2368 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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