Skip to content

Instantly share code, notes, and snippets.

@adrianknight89
Created December 26, 2016 23:35
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 adrianknight89/e35d769961fc367edad9d19ca73b0679 to your computer and use it in GitHub Desktop.
Save adrianknight89/e35d769961fc367edad9d19ca73b0679 to your computer and use it in GitHub Desktop.
using Xamarin.Forms;
using Xamarin.Forms.Internals;
using Xamarin.Forms.PlatformConfiguration;
using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
using Application = Xamarin.Forms.Application;
namespace App1gh88
{
public class App : Application
{
public App()
{
this.On<Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize);
MainPage = new ContentPage47548();
}
}
[Preserve(AllMembers = true)]
public class ContentPage47548 : ContentPage
{
public ContentPage47548()
{
Title = "ContentPage47548";
var scrollView = new ScrollView();
var stackLayout = new StackLayout
{
VerticalOptions = LayoutOptions.Center,
Spacing = 10
};
for (var i = 0; i < 15; i++)
{
var entry = new Entry
{
WidthRequest = 250,
HeightRequest = 50
};
stackLayout.Children.Add(entry);
}
var b = new Button
{
Text = "ContentPage",
Command = new Command(() =>
{
Xamarin.Forms.Application.Current.MainPage = new ContentPage47548();
})
};
stackLayout.Children.Add(b);
var b2 = new Button
{
Text = "NavigationPage",
Command = new Command(() =>
{
Xamarin.Forms.Application.Current.MainPage = new NavigationPage(new ContentPage47548());
})
};
stackLayout.Children.Add(b2);
var b3 = new Button
{
Text = "MasterDetailPage",
Command = new Command(() =>
{
var masterDetailPage = new MasterDetailPage
{
Master = new ContentPage() { Title = "Master" },
Detail = new NavigationPage(new ContentPage47548())
};
Xamarin.Forms.Application.Current.MainPage = masterDetailPage;
})
};
stackLayout.Children.Add(b3);
scrollView.Content = stackLayout;
Content = scrollView;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment