2013-09-25 72 views
1

我開始爲windows phone 7編寫一個應用程序,但是當我在模擬器中測試它時,屏幕邊上有一個空白的條帶,我無法填充。這裏是頁面的XAML: 全屏幕上的windows phone 7應用程序

<!--LayoutRoot is the root grid where all page content is placed--> 
<Grid x:Name="LayoutRoot" Background="Transparent"> 
    <Grid.ColumnDefinitions> 
     <ColumnDefinition Width="776*" /> 
     <ColumnDefinition Width="24*" /> 
    </Grid.ColumnDefinitions> 
    <Grid.RowDefinitions> 
     <RowDefinition Height="0"/> 
     <RowDefinition Height="480*"/> 
    </Grid.RowDefinitions> 

    <!--TitlePanel contains the name of the application and page title--> 
    <StackPanel x:Name="TitlePanel" Grid.Row="1" Margin="0,0,0,0" Grid.ColumnSpan="2"> 
     <Image Height="480" Name="image1" Stretch="Fill" Width="728" Source="/app;component/Background.jpg" /> 
     <MediaElement Height="0" Name="mediaElement1" Width="1" Volume="1" Source="Kalimba.mp3" /> 
    </StackPanel> 

    <Image Grid.Row="1" Height="51" HorizontalAlignment="Left" Margin="78,164,0,0" Name="image2" Stretch="Fill" VerticalAlignment="Top" Width="180" Source="/app;component/Easy_Button_Normal.png" /> 
    <Image Grid.Row="1" Height="51" HorizontalAlignment="Left" Margin="468,164,0,0" Name="image3" Source="/app;component/Hard_Button_Normal.png" Stretch="Fill" VerticalAlignment="Top" Width="180" /> 
    <Image Grid.Row="1" Height="51" HorizontalAlignment="Left" Margin="272,164,0,0" Name="image4" Source="/app;component/Medium_Button_Normal.png" Stretch="Fill" VerticalAlignment="Top" Width="180" /> 
    <Image Grid.Row="1" Height="118" HorizontalAlignment="Left" Margin="286,362,0,0" Name="image5" Stretch="Uniform" VerticalAlignment="Top" Width="148" Source="/app;component/Play_Button_Normal.png" /> 
    <Image Grid.Row="1" Height="36" HorizontalAlignment="Left" Margin="78,122,0,0" Name="image6" Stretch="Fill" VerticalAlignment="Top" Width="238" Source="/app;component/Headline.png" /> 
    <Image Grid.Row="1" Height="34" HorizontalAlignment="Left" Margin="620,426,0,0" Name="image7" Stretch="Fill" VerticalAlignment="Top" Width="32" Source="/app;component/Play_Button.png" Tap="image7_Tap" /> 
    <Image Grid.Row="1" Height="34" HorizontalAlignment="Left" Margin="58,426,0,0" Name="image8" Source="/app;component/Scores_Button.png" Stretch="Fill" VerticalAlignment="Top" Width="32" Tap="image8_Tap" /> 
    <!--ContentPanel - place additional content here--> 
</Grid> 

<!--Sample code showing usage of ApplicationBar--> 
<!--<phone:PhoneApplicationPage.ApplicationBar> 
    <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True"> 
     <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/> 
     <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/> 
     <shell:ApplicationBar.MenuItems> 
      <shell:ApplicationBarMenuItem Text="MenuItem 1"/> 
      <shell:ApplicationBarMenuItem Text="MenuItem 2"/> 
     </shell:ApplicationBar.MenuItems> 
    </shell:ApplicationBar> 
</phone:PhoneApplicationPage.ApplicationBar>--> 

誰能幫助我? 謝謝

回答

1

手機上沒有「全屏」概念。只需更改控件,使其佔據整個屏幕。

您可以明確地做到這一點,或者如果您將尺寸設置爲自動,只需隱藏屏幕上的所有其他項目。

Windows Phone 7和Windows Phone 8屏幕尺寸(分辨率)之間的所有區別都解釋爲here。 (在MSDN網站上,帶有樣本)。

在windows phone上,您必須管理所有屏幕分辨率......如果您默認有一個項目Windows Phone 7,則您的屏幕尺寸將根據此項目進行調整,並且您使用的是WVGA(480 * 800)。而且,如果你不管理所有尺寸的屏幕,在720p的Windows Phone設備(或模擬器)上,你是應用程序頂部黑屏的一部分。

For informations: Windows Phone 7 devices just manage

  • 的WVGA分辨率(480 * 800)

Windows Phone 8 devices manage three screen sizes:

  • 的WVGA分辨率(480 * 800)
  • 的WXGA 8位分辨率(768×1280)
  • 的720p分辨率(720×1280) //傳言部分

而且,也許隨着Windows Phone 8和GDR3更新,Windows Phone的管理一個額外的屏幕尺寸

  • 1080號決議(1080 * 1920) //結束的傳言部分

確保有屬性的

<phone:phoneApplicationPage shell:SystemTray.IsVisible="True"> 

對於全屏顯示必須設置爲false。

+0

我在找的是IsVisible屬性。謝謝! – user2814218

0

您正在網格中設置兩列,但只使用一列。嘗試刪除列定義:

<Grid.ColumnDefinitions> 
     <ColumnDefinition Width="776*" /> 
     <ColumnDefinition Width="24*" /> 
    </Grid.ColumnDefinitions>