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

how to correctly add views in layoutview programmatically - size is always wrong,

$
0
0

my view extends AbsoluteLayout

    public EditWebPanelContentView ()
    {
        _webView = new WebView ();
        Children.Insert (0, _webView);
    }

    protected override void LayoutChildren (double x, double y, double width, double height)
    {
        base.LayoutChildren (x, y, width, height);
        _webView.Layout (new Rectangle (0, 0, width, height));
    }

the children of the view do not get resized when layout is called. I can see this in reveal app - the webview renderer is the correct size; but the webview inside it is size zero. this always happens when I follow this patter, which I want to use a lot, as it's the quickest most flexible for laying out views in my custom components..


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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