1中禁用网格的方向更改

1中禁用网格的方向更改

本文介绍了在Windows Phone 8.1中禁用网格的方向更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能禁用Windows Phone 8.1中特定元素的方向更改



以下是我要禁用方向更改的代码在gridONE网格上,即使屏幕方向更改为横向,网格仍然保留在纵向视图中。



Is there a possible way to disable the orientation change for a particular element in Windows Phone 8.1

Below is my code in which I want to disable the orientation change on the gridONE Grid so that even after the Screen Orientation changes to Landscape, the Grid still stays in the portrait view.

<Page

    x:Class="DemoUI.BlankPage1"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:local="using:DemoUI"

    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

    mc:Ignorable="d"

    removed="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Grid>

        <Grid x:Name="gridONE">
            <TextBox Text="This is a Sample TextBox" />
        </Grid>
        <Grid x:Name="gridTWO">

        </Grid>

    </Grid>
</Page>





我想确保当屏幕从纵向视图切换到横向视图时,网格的位置和方向不会改变。



谢谢,



I want to make sure that the position and orientation of the Grid does not changes when the screen changes to Landscape view from Portrait view.

Thanks,

推荐答案


这篇关于在Windows Phone 8.1中禁用网格的方向更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 05:16