Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows phone 8 Windows 8 phone emulator方向更改按钮不存在';“不要改变或开火”;OnOrientationChanged“;_Windows Phone 8_Windows Phone 8 Emulator - Fatal编程技术网

Windows phone 8 Windows 8 phone emulator方向更改按钮不存在';“不要改变或开火”;OnOrientationChanged“;

Windows phone 8 Windows 8 phone emulator方向更改按钮不存在';“不要改变或开火”;OnOrientationChanged“;,windows-phone-8,windows-phone-8-emulator,Windows Phone 8,Windows Phone 8 Emulator,我正在做一个Windows8手机项目,我注意到点击方向键 右上角的“更改”按钮未按预期运行 手机仿真器将更改为横向位置,但是视图不会更改,并且不会触发OnOrientationChanged事件 此外,从开始,执行此操作时,PhoneApplicationPage.Orientation属性也不会更改。这是仿真器中的一个bug吗?其他人对此有什么运气吗 windows 8 phone是否应该自动重新排列UI元素?即使您没有为该视图指定专门的布局?Windows Phone 8上的Orientat

我正在做一个Windows8手机项目,我注意到点击方向键 右上角的“更改”按钮未按预期运行

手机仿真器将更改为横向位置,但是视图不会更改,并且不会触发
OnOrientationChanged
事件

此外,从
开始,执行此操作时,PhoneApplicationPage.Orientation属性也不会更改。这是仿真器中的一个bug吗?其他人对此有什么运气吗


windows 8 phone是否应该自动重新排列UI元素?即使您没有为该视图指定专门的布局?

Windows Phone 8上的
OrientationChanged
事件仍应有效。确保在页面的
SupportedOrientations
属性中放置
graphitorlandscape

<phone:PhoneApplicationPage 
    x:Class="WP8Application.Page1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"        
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True" 
    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
    OrientationChanged="PhoneApplicationPage_OrientationChanged_1">

关键是,如果您仅将
纵向
横向
保留在支持的方向上,则不会触发
方向更改
事件,因为即使您旋转手机,应用程序的方向实际上也不会更改


至于你的另一个问题,是的,Windows Phone应该自动重新安排你的UI元素,当你正确设置
SupportedOrientations
属性时就会发现这一点。在大多数情况下,只要您没有明确地以像素为单位设置元素的位置,自动布局就应该适合您的需要。

方向不应该是纵向的,如果您希望页面在两种方向上都工作,则应省略该参数,只保留SupportedOrientations参数。 当您从纵向转到横向时,Emulator中不起作用的是InputScope。 似乎没有人提到那件事