【问题标题】:Xamarin.Forms WindowsPhone Landscape NavigationPage shows black areaXamarin.Forms WindowsPhone Landscape NavigationPage 显示黑色区域
【发布时间】:2016-01-14 17:06:13
【问题描述】:

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

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

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 中的错误吗?还是想念我只是什么?提前致谢

【问题讨论】:

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


    【解决方案1】:

    我看不到任何现有的已提交错误。如果按照描述很容易重现,则创建一个小型重现项目并提交到 bugzilla.xamarin.com。这将是一个 xf 回归错误。

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

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-03
    • 1970-01-01
    • 2020-10-20
    • 2016-06-11
    • 2012-09-26
    相关资源
    最近更新 更多