次の方法で共有


Windows での Page のツール バーの配置

このユニバーサル Windows プラットフォームのプラットフォーム固有設定は、Page でツール バーの配置を変更するために使用され、Page.ToolbarPlacement 添付プロパティを ToolbarPlacement 列挙型の値に設定することで XAML で使用されます。

<TabbedPage ...
            xmlns:windows="clr-namespace:Xamarin.Forms.PlatformConfiguration.WindowsSpecific;assembly=Xamarin.Forms.Core"
            windows:Page.ToolbarPlacement="Bottom">
  ...
</TabbedPage>

また、Fluent API を使用して C# から使用することもできます。

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

page.On<Windows>().SetToolbarPlacement(ToolbarPlacement.Bottom);

Page.On<Windows> メソッドは、このプラットフォーム固有設定が Windows でのみ実行されるように指定します。 Xamarin.Forms.PlatformConfiguration.WindowsSpecific 名前空間の Page.SetToolbarPlacement メソッドは、ツール バーの配置を設定するために使用され、ToolbarPlacement 列挙型では 3 つの値 DefaultTopBottom を提供します。

その結果、指定したツール バーの配置が Page インスタンスに適用されます。

ツール バー配置プラットフォーム固有