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

Is there a problem with WebView (Android) in a stack?

$
0
0

I was trying to get the Labs HybridWebView working but eventually I found that WebView seems to not render when in a stack.

The label and button would render but the webview never seemed to render.

Was I doing something dumb that just happened to compile?

The sort of code I was trying was:

>

    public static Page GetMainPage ()
    {   

        var cpg = new ContentPage();

        var label = new Label { Text = "Hi" };
        var hwv = new WebView {
            Source= new Uri("https://www.yahoo.com/?q=monkey")
        };  //WebView or HybridWebView
        var btn = new Button { Text = "Click me" };


        var mylayout = new StackLayout 
        { 
            Spacing = 0,
            VerticalOptions = LayoutOptions.FillAndExpand,
            Children = 
            { 
                label,
                hwv,
                btn
            }
        }; // end new StackLayout


        cpg.Content  = mylayout;  //if you just set cpg.Content to hwv then you see the web view???

        return cpg;
    }

<<<<<<<<<<<<<<<<<<<<<<<<

Any help/advise appreciated.

Thanks
Steve


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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