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

Reset Webview

$
0
0

Hi all,

I have a tabbed page layout. The problem I have is that each pages loads a new webview. I would like it so that when you click on the icon/title at the bottom it can reset the webview to the original url. Any help is greatly appreciated.

namespace Test
{
public partial class Profile : ContentPage
{
public Profile ()
{

        Image header = new Image {
            Source = "logo.png"
        };
        Title = "Profile";
        Icon = "145-persondot.png";

        MyWebView webView = new MyWebView
        {
            Source = new UrlWebViewSource
            {
                Url = "http://www.cnn.com/",
            },
            VerticalOptions = LayoutOptions.FillAndExpand,
        };

        // Accomodate iPhone status bar.
        //this.Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5);
        this.Padding = new Thickness (0, Device.OnPlatform (20, 0, 0), 0, 5);

        // Build the page.
        this.Content = new StackLayout {
            Children = {
                header,
                webView
            }
        };
    }
}

}


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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