我正在尝试编写一个程序,该程序将用作另一个程序之上的覆盖。我希望文本、按钮和边框是实心的,背景是透明的。
<VerticalStackLayout Spacing="25" Padding="30" BackgroundColor="Transparent" IsVisible="True" Opacity="1">
Run Code Online (Sandbox Code Playgroud)
这适用于其中一层,但似乎有多个层。
这里 提到更改ContentPage,我尝试过,但似乎不起作用。
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="NameSpace.MainPage"
xmlns:local="clr-namespace:NameSpace"
BackgroundColor="Transparent">
Run Code Online (Sandbox Code Playgroud)
我也尝试过:
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="NameSpace.MainPage"
xmlns:local="clr-namespace:NameSpace.Core.Views.CustomControls"
BackgroundColor="Transparent">
Run Code Online (Sandbox Code Playgroud)
我将外壳更改为包含透明背景颜色,但这没有帮助。
<Shell
x:Class="NameSpace.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:NameSpace"
Shell.FlyoutBehavior="Disabled"
BackgroundColor="Transparent">
Run Code Online (Sandbox Code Playgroud)
更改 ContentPage 或 Shell 时,似乎没有任何变化。
这些似乎都没有改变 VerticalStackLayout 后面的背景颜色。有任何想法吗?