0

所以我的 MainPage 有这个代码,例如:

    <Viewbox Stretch="Uniform" >
    <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="640" Margin="0,-20,0,0" VerticalAlignment="Top" Width="360">
        <Canvas.Background>
            <ImageBrush Stretch="Fill" ImageSource="Assets/start-01.jpg"/>
        </Canvas.Background>
        <Image x:Name="play" Height="34" HorizontalAlignment="Left" VerticalAlignment="Top"  Margin="78,281,0,325" Width="194" Source="Assets/start bottuns-01.png" Stretch="Fill" Tapped="play_Tapped"/>
        <TextBlock x:Name="playTB" Height="34" TextWrapping="Wrap" Text="RACE" FontSize="30" CharacterSpacing="364" Tapped="play_Tapped" FontFamily="Lucida Sans Unicode"  HorizontalAlignment="Left" VerticalAlignment="Top" Canvas.Left="125" Canvas.Top="279" />
        <Image x:Name="highscoresBT" HorizontalAlignment="Left" Height="34" Margin="78,335,0,0" VerticalAlignment="Top" Width="194" Source="Assets/start bottuns-01.png" Stretch="Fill" Tapped="highscoresBT_Tapped"/>
        <TextBlock x:Name="highscoreTB" Height="34" Margin="88,335,0,0" TextWrapping="Wrap" Text="HIGHSCORES" FontSize="24" VerticalAlignment="Top" CharacterSpacing="100" Tapped="highscoresBT_Tapped" FontFamily="Lucida Sans Unicode"/>
        <Image x:Name="storeBT" HorizontalAlignment="Left" VerticalAlignment="Top"  Height="34" Margin="78,398,0,0" Width="194" Source="Assets/start bottuns-01.png" Stretch="Fill" Tapped="storeBT_Tapped"/>
        <TextBlock x:Name="storeTB" HorizontalAlignment="Left" Height="34" Margin="111,392,0,0" TextWrapping="Wrap" Text="STORE" Width="151" FontSize="30" VerticalAlignment="Top" CharacterSpacing="364" Tapped="storeBT_Tapped"/>
        <Image x:Name="helpBut" Height="96" Margin="115,511,122,0" VerticalAlignment="Top" Source="Assets/helpBut-01.png" Tapped="helpBut_Tapped" d:LayoutOverrides="HorizontalAlignment, LeftPosition, RightPosition"/>
        <Image x:Name="coinsBG" HorizontalAlignment="Left" Height="18" Margin="294,12,0,0" VerticalAlignment="Top" Width="56" Source="Assets/comp bar-01.png" Stretch="Fill"/>
        <Image x:Name="coinsIC" HorizontalAlignment="Left" Height="18" VerticalAlignment="Top" Width="14" Source="Assets/coins-01.png" Margin="328,13,0,0"/>
        <TextBlock x:Name="coinsOwnedTB" HorizontalAlignment="Left" Height="14" Margin="302,14,0,0" TextWrapping="Wrap" Text="120" VerticalAlignment="Top" Width="21" FontSize="10" FontFamily="Lucida Sans Unicode" Foreground="#FF535257"/>
        <Image x:Name="scoreBG" HorizontalAlignment="Left" Height="22" VerticalAlignment="Top" Width="136" Source="Assets/comp bar-01.png" Stretch="Fill" Margin="12,12,0,0" d:LayoutOverrides="HorizontalAlignment"/>
        <TextBlock x:Name="scoreNameTB" HorizontalAlignment="Left" Height="20" TextWrapping="Wrap" Text="Score: " VerticalAlignment="Top" Width="48" FontSize="14" FontFamily="Lucida Sans Unicode" Foreground="#FF535257" Canvas.Left="13" Canvas.Top="11"/>
        <TextBlock x:Name="scoreTB" HorizontalAlignment="Left" Height="20" TextWrapping="Wrap" Text="15000" VerticalAlignment="Top" Width="87" FontSize="14" FontFamily="Lucida Sans Unicode" Foreground="#FF535257" Canvas.Left="61" Canvas.Top="11" Margin="0,1,0,0"/>
        <Image x:Name="feedbackBT" HorizontalAlignment="Left" Height="34" Margin="78,461,0,0" VerticalAlignment="Top" Width="194" Source="Assets/start bottuns-01.png" Stretch="Fill" Tapped="feedback_Tapped"/>
        <TextBlock x:Name="feedbackTB" Height="34" TextWrapping="Wrap" Text="SUPPORT" FontSize="30" VerticalAlignment="Top" Tapped="feedback_Tapped" FontFamily="Lucida Sans Unicode" TextAlignment="Center" CharacterSpacing="200" Canvas.Left="91" Canvas.Top="458"/>
    </Canvas>
</Viewbox>

问题是图像顶部的 TextBlocks 有时由于某种原因在 Windows Phone 模拟器(所有尺寸)上移动了一点,在本地机器上启动时不会发生这种情况(顺便说一句,我使用 VS 2015)。看看太例子:

1)原文位置

这就是它应该的样子,有时结果就是这样: 2)移动的文本

注意 TextBlocks 像 RACE 一样向上移动了一点,令人困惑的是这并不总是发生我连续运行应用程序 5 次 2 会很好,3 与此文本移位。

任何人对此可能有任何想法,或者可能只是模拟器问题,在实际手机上应该没问题?谢谢

4

0 回答 0