Skip to content

Instantly share code, notes, and snippets.

@jgold6
Created July 22, 2014 22:49
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 jgold6/a0463fc99da069a0efcf to your computer and use it in GitHub Desktop.
Save jgold6/a0463fc99da069a0efcf to your computer and use it in GitHub Desktop.
TableView2
public static Page GetMainPage()
{
// TableView2 in code
return new NavigationPage (new ContentPage {
Content = new StackLayout {
Children = {
new TableView {
Intent = TableIntent.Settings,
Root = new TableRoot ("Settings") {
new TableSection ("Notifications") {
new ViewCell {
View = new StackLayout {
Padding = new Thickness(20.0, 0.0, 0.0, 0.0),
VerticalOptions = LayoutOptions.Start,
Orientation = StackOrientation.Horizontal,
Children = {
new Label {Text = "Notifications", WidthRequest = 100.0, YAlign = TextAlignment.Center},
new StackLayout {HorizontalOptions = LayoutOptions.EndAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, Orientation = StackOrientation.Vertical},
new Switch{IsToggled = true}
}
}
},
new ViewCell {
View = new StackLayout {
VerticalOptions = LayoutOptions.Start,
Orientation = StackOrientation.Horizontal,
Children = {
new Label {Text = "Max", WidthRequest = 100.0, YAlign = TextAlignment.Center},
new StackLayout {HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, Orientation = StackOrientation.Vertical},
new Entry()
}
}
}
},
new TableSection ("Network") {
new TextCell {Text="To change a setting below, please change on your device.", IsEnabled = false},
new SwitchCell {Text = "test1", On = true},
new SwitchCell {Text = "test2", On = true},
new SwitchCell {Text = "test3", On = true},
new SwitchCell {Text = "test4", On = true}
}
}
}
}
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment