具有透明背景的WebView

时间:2016-10-29 15:30:51

标签: xamarin webview

如何在Xamarin.Forms PCL中创建具有透明背景的WebView?

Xaml中的T​​hic代码无效。

<WebView Source="http://xxx.pl/" BackgroundColor="Transparent"/>

1 个答案:

答案 0 :(得分:1)

除了在HTML中设置背景颜色/透明度/ alpha之外,您还必须设置本机控件的背景颜色:

  • Android:将WebView背景颜色设置为Black

    BackgroundColor = 0;

  • iOS:将WKWebViewUIWebView背景设为Clear

    BackgroundColor = UIColor.Clear

相关问题