我有一个TextBlock和一个Rectangle,它们都位于一个空的WPF4窗口中。 TextBlock的Foreground和Rectangle的Fill都设置为SolidColorBrush,值为#80800000。
这就是它的样子:
矩形的颜色是正确的(50%透明的栗色),但TextBlock呈灰色。发生了什么事?
编辑:这是XAML:
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<TextBlock Foreground="#80800000" Height="100" HorizontalAlignment="Left" Margin="47,39,0,0" Text="TextBlock" VerticalAlignment="Top" Width="266" FontFamily="Arial" FontWeight="Bold" FontSize="56" />
<Rectangle Fill="#80800000" Height="100" HorizontalAlignment="Left" Margin="71,174,0,0" Stroke="{x:Null}" VerticalAlignment="Top" Width="200" />
</Grid>
</Window>