当移动设备方向向左或向右旋转时,我的UWP应用会显示白色间隙。
我的XAML:
<prismMvvm:SessionStateAwarePage>
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<ListBox Grid.Row="0" x:Name="VideoItemsListBox">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding title}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<MediaElement x:Name="VideoPlayer" Grid.Row="1">
</MediaElement>
</Grid>
我是否需要实施一些措施来消除这种差距?我怎样才能解决这个问题?
答案 0 :(得分:1)
好像条纹是状态栏。 Hide the status bar如下所示可以解决您的问题。
public RemoveGap()
{
this.InitializeComponent();
if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
{
StatusBar.GetForCurrentView().HideAsync();
}
}