我正在創建一個自定義加載消息,我想僅將背景設置爲半透明。我遇到的問題是整個堆疊面板設置爲半透明,包括背景和前景。我如何才能使背景變得半透明,並且讓前景保持原樣?以下是我的xaml代碼。如何設置半透明背景,但不是前景的WP8?
<StackPanel Grid.Row="0" x:Name="spLoading" HorizontalAlignment="Center" VerticalAlignment="Center" Background="Transparent">
<Border Margin="5" Padding="5" BorderThickness="1" BorderBrush="Black" Background="Black" Opacity=".1" CornerRadius="10">
<TextBlock x:Name="txtLoading" Foreground="White" Text="loading . . ." HorizontalAlignment="Center" TextAlignment="Center" FontSize="30" FontWeight="Bold" Padding="5" />
</Border>
</StackPanel>
實際上,我只是想要「加載」具有純色,但其他一切都是半透明的。 – amarankes
我認爲代碼應該是這樣的,但不知道什麼是正確的synatx。裏面的一些邏輯 –
amarankes
你的意思是說像我添加的邊框的中風和背景? –