使用 PlatformConfiguration (Xamarin.Forms 2.3.3) 在 UWP 中将工具栏移动到底部

Posted

技术标签:

【中文标题】使用 PlatformConfiguration (Xamarin.Forms 2.3.3) 在 UWP 中将工具栏移动到底部【英文标题】:Move Toolbar to the bottom in UWP with PlatformConfiguration (Xamarin.Forms 2.3.3) 【发布时间】:2017-03-21 22:15:57 【问题描述】:

Xamarin.Forms 2.3.3.166-pre4 中尝试新的 PlatformConfiguration,但在 UWP 上将工具栏移动到底部只是不想工作。我做错了什么?

using Xamarin.Forms;
using Xamarin.Forms.PlatformConfiguration;
using Xamarin.Forms.PlatformConfiguration.WindowsSpecific;

namespace FormsToolBarDemo

    public partial class MainPage:ContentPage
    
        public MainPage()
        
            InitializeComponent();
            this.On<Windows>().SetToolbarPlacement(ToolbarPlacement.Bottom);
        
    

【问题讨论】:

【参考方案1】:

好吧,在尝试了SetToolbarPlacement(ToolbarPlacement.Bottom)的所有可能组合之后,我发现了一些东西:

工具栏位置只能在应用程序范围内设置,不能在每页设置 工具栏位置只能设置在NavigationPage

所以你可以做什么,当你想把工具栏放在底部时,你可以通过将工具栏放置附加到AppMainPage属性来设置它的应用程序范围。

public App()

    MainPage = new NavigationPage(new MainPage());
    MainPage.On<Windows>().SetToolbarPlacement(ToolbarPlacement.Bottom);

【讨论】:

以上是关于使用 PlatformConfiguration (Xamarin.Forms 2.3.3) 在 UWP 中将工具栏移动到底部的主要内容,如果未能解决你的问题,请参考以下文章

Xamarin Forms - 状态栏与 IOS 中的内容重叠(safeareainsets 问题)

开启HP DL380 G10服务器网卡的网络启动(PXE)项

HP ML350 Gen9安装Windows Server 2008 R2(官网文档)

测试使用

第一篇 用于测试使用

在使用加载数据流步骤的猪中,使用(使用 PigStorage)和不使用它有啥区别?