Skip to content

Instantly share code, notes, and snippets.

@YutaWatanabe
Created September 28, 2014 02:07
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 YutaWatanabe/523ab028ccf6537b555b to your computer and use it in GitHub Desktop.
Save YutaWatanabe/523ab028ccf6537b555b to your computer and use it in GitHub Desktop.
xamarin.forms sample
return new TabbedPage {
Children = {
new ContentPage {
Title = "Home",
Content = new StackLayout {
VerticalOptions = LayoutOptions.CenterAndExpand,
HorizontalOptions = LayoutOptions.CenterAndExpand,
Children = {
new Label {
Text = "Xamarin.Forms",
Font = Font.SystemFontOfSize (NamedSize.Large)
}
}
}
},
new ContentPage {
Title = "Login",
Content = new StackLayout {
Spacing = 20, Padding = 50,
VerticalOptions = LayoutOptions.Center,
Children = {
new Entry { Placeholder = "Username" },
new Entry { Placeholder = "Password", IsPassword = true },
new Button {
Text = "Login",
TextColor = Color.White,
BackgroundColor = Color.FromHex("77D065")
}
}
}
},
new ContentPage {
Title = "Settings",
Content = new TableView {
Intent = TableIntent.Settings,
Root = new TableRoot {
new TableSection (" ") {
new SwitchCell {Text = "Airplane Mode"},
new SwitchCell {Text = "Notifications"}
},
new TableSection (" ") {
new EntryCell { Label="Login", Placeholder = "username" }
, new EntryCell {Label="Password", Placeholder = "password" }
},
new TableSection ("Silent") {
new SwitchCell {Text = "Vibrate", },
new ViewCell { View = new Slider() }
},
new TableSection ("Ring") {
new SwitchCell {Text = "New Voice Mail"},
new SwitchCell {Text = "New Mail", On = true}
},
}
}
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment