Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Parmendrak
Created April 25, 2016 17:17
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 Parmendrak/4c9cf8883b447e7d6c8566a13f093398 to your computer and use it in GitHub Desktop.
Save Parmendrak/4c9cf8883b447e7d6c8566a13f093398 to your computer and use it in GitHub Desktop.
using System;
using Xamarin.Forms;
namespace xvfgdgfd
{
public class App : Application
{
Label resultsLabel;
SearchBar searchBar;
public App ()
{
resultsLabel = new Label {
Text = "Result will appear here.",
VerticalOptions = LayoutOptions.FillAndExpand,
FontSize = 25
};
searchBar = new SearchBar
{
Placeholder = "Enter search term",
SearchCommand = new Command(() => {resultsLabel.Text = "Result: " + searchBar.Text + " is what you asked for.";})
};
MainPage = new ContentPage {
Content = new StackLayout {
VerticalOptions = LayoutOptions.Start,
Children = {
new Label {
HorizontalTextAlignment = TextAlignment.Center,
Text = "SearchBar",
FontSize = 50
},
searchBar,
new ScrollView
{
Content = resultsLabel,
VerticalOptions = LayoutOptions.FillAndExpand
}
},
Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5)
}
};
}
protected override void OnStart ()
{
// Handle when your app starts
}
protected override void OnSleep ()
{
// Handle when your app sleeps
}
protected override void OnResume ()
{
// Handle when your app resumes
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment