I have a webview in a ContentPage. Now, I want a button below it. Anyone know how do I do that, please?
I have the following code, and it's not working. I only get the button with no webview. I've tried it with and without ScrollView with same result.
public class TestWebViewButtonPage : ContentPage
{
public TestWebViewButtonPage()
{
this.Title = "WebView with Button";
var browser = new WebView();
browser.Source = "http://www.xamarin.com/";
//Content = browser;
var btnTest = new Button { Text = "Refresh" };
btnTest.Clicked += (sender, e) =>
{
//REFRESH CODE HERE
};
var scrollview = new ScrollView
{
Content = new StackLayout
{
#region VIEW
VerticalOptions = LayoutOptions.StartAndExpand,
Padding = new Thickness(20),
Children =
{
browser, btnTest
}
#endregion
}
};
this.Content = scrollview;
}
}