Xamarin.Forms WindowsPhone Landscape NavigationPage显示黑色区域

时间:2016-01-13 10:26:49

标签: windows-phone-8.1 xamarin.forms landscape-portrait

我在WinPhone客户端上的Xamarin.Forms应用程序中有一个奇怪的行为。  我的MainPage是一个NavigationPage。当我导航到第二页并将手机转为横向(也发生在另一方面)时,页面右侧显示黑色区域。似乎高度和宽度属性不会在设备方向更改时重新计算。

要重现这一点,只需创建一个新的Xamarin.Forms空白应用程序(Visual Studio 2013模板),将Xamarin.Forms nuget更新为最新的版本(在我的情况下:2.0.0.6490),并将以下内容添加到App -Constructor:

var second = new ContentPage
{
    BackgroundColor = Color.Green,
    Content = new StackLayout
    {
        VerticalOptions = LayoutOptions.Center,
        Children = {
            new Label {
                XAlign = TextAlignment.Center,
                Text = "Second Page"
            }
        }
    }
};

var button = new Button {Text = "Show Second"};
button.Clicked += async (sender, args) => { await ((NavigationPage) MainPage).PushAsync(second); };

var firstpage = new ContentPage
{
    BackgroundColor = Color.Blue,
    Content = new StackLayout
    {
        VerticalOptions = LayoutOptions.Center,
        Children = {
            new Label {
                XAlign = TextAlignment.Center,
                Text = "First Page"
            },
            button
        }
    }
};

// The root page of your application
MainPage = new NavigationPage(firstpage);

这是Xamarin.Forms中的错误吗?或者我想念一下?提前致谢

1 个答案:

答案 0 :(得分:1)

我无法看到任何现有的错误。如果它如上所述易于重现,则创建一个小的repro项目并提交给bugzilla.xamarin.com。这将是一个xf回归错误。

谢谢@Joehl - 我显然不太擅长在手机上搜索bugzilla。如上所述,这是错误报告:https://bugzilla.xamarin.com/show_bug.cgi?id=36477