【发布时间】:2020-01-22 13:53:57
【问题描述】:
页面标记
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage NavigationPage.HasNavigationBar="false" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="ConnectedLifeView.NativeApp.Pages.LoginSuccessPage">
<ContentPage.Content>
<StackLayout VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Margin="0" Padding="0">
<WebView x:Name="webView" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" BackgroundColor="#02114D"/>
</StackLayout>
</ContentPage.Content>
</ContentPage>
我尝试将背景颜色添加到内容页面并将 WebView 背景颜色设置为透明,但它也没有效果。
我的所有其他页面都有正确的背景,但是这个页面看起来有点奇怪,因为它在 WebView 中加载 URL 时显示白色背景。
Xamarin.Forms 版本:4.2.0.815419
平台:安卓
【问题讨论】:
-
加载具有适当背景颜色的静态 HTML 字符串
-
添加静态 HTML 不起作用,因为 WebView 在尝试加载 URL 后立即变为空白
标签: android xaml xamarin xamarin.forms xamarin.forms.webview