Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Webview and Button in same ContentPage (button only showing :( )

$
0
0

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;
        }
    }

Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>