我已经为启动画面创建了一个用户控件,以便在我的应用启动时显示,请参阅下面的代码。但问题是,我希望在其上显示的文本和程序栏不会显示。我无法弄清楚我在这里做错了什么?它可能很简单!
代码:
<UserControl
x:Class="ContosoSocial.SplashScreenPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}">
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" >
<Image Stretch="Fill" VerticalAlignment="Top" Width="480" Source="SplashScreenImage.jpg"></Image>
<TextBox HorizontalAlignment="Left"
TextAlignment="Center"
Height="60"
Margin="14,630,0,0"
TextWrapping="Wrap"
Text="App & Database..."
VerticalAlignment="Top"
Width="456"
AcceptsReturn="True"
FontSize="16"
BorderBrush="{x:Null}"
Background="{x:Null}"
Foreground="White"
SelectionBackground="{x:Null}"
SelectionForeground="{x:Null}"/>
<ProgressBar HorizontalAlignment="Left"
Height="10"
Margin="10,680,0,0"
VerticalAlignment="Top"
Width="460"
IsIndeterminate="True"
Foreground="White"/>
<ProgressBar HorizontalAlignment="Left"
Height="10"
Margin="10,695,0,0"
VerticalAlignment="Top"
Width="460"
FlowDirection="RightToLeft"
Foreground="White"
IsIndeterminate="True"/>
<!--TitlePanel contains the name of the application and page title-->
</Grid>
控件在Visual Studio窗口中运行正常,我可以在启动画面图像上看到文本和进度条在顶部运行。
答案 0 :(得分:1)
您的代码运行正常。只需添加
Background="{StaticResource PhoneChromeBrush}"
在您的LayoutRoot网格中,因为您的文本似乎是白色的。您可以参考我尝试过的source code。