Xamarin表单-缩放webview以适应屏幕或使webview填满屏幕

Xamarin表单-缩放webview以适应屏幕或使webview填满屏幕,webview,xamarin.forms,scale,Webview,Xamarin.forms,Scale,我目前正在做一个项目,它是一个“gif”控件。这是一个成功,但我被困在缩放我的“gif”上。。(#网络视图) public类Gif:WebView { 公共接口IBaseUrl{string Get();} 公共字符串源 { 设置 { var html=新的HtmlWebViewSource(); html.BaseUrl=DependencyService.Get().Get(); html.html=String.Format(@“”,400,值); SetValue(SourcePrope

我目前正在做一个项目,它是一个“gif”控件。这是一个成功,但我被困在缩放我的“gif”上。。(#网络视图)

public类Gif:WebView
{
公共接口IBaseUrl{string Get();}
公共字符串源
{
设置
{
var html=新的HtmlWebViewSource();
html.BaseUrl=DependencyService.Get().Get();
html.html=String.Format(@“”,400,值);
SetValue(SourceProperty,html);
这个。边际=-10;
}
}
}
我希望这个“gif”出现在整个屏幕上,我的意思是它可能会溢出屏幕,这对我来说无关紧要

问题是我尝试了很多东西,但仍然不起作用。。唯一有效但不适用的方法是将宽度/高度参数添加到
”,400,值);

我可以基于屏幕大小属性,但我需要知道在这种情况下GIF图像的大小,以及如何访问它

此外,我还想过通过编程方式滚动到WebView的中心,但是,再一次,我找不到实现它的方法

老实说,我开始没主意了,有人能帮我吗


提前感谢!

您对此有什么好运气吗?是的,它工作得很好,
public class Gif : WebView
{
    public interface IBaseUrl { string Get(); }

    public string GifSource
    {
        set
        {
            var html = new HtmlWebViewSource();
            html.BaseUrl = DependencyService.Get<IBaseUrl>().Get();
            html.Html = String.Format(@"<html><body><img width='{0}' src='{1}'/></body></html>", 400, value);
            SetValue(SourceProperty, html);
            this.Margin = -10;
        }
    }
}