如何在xamarin表单的工具栏中添加选择器

Nee*_*ati 3 toolbar picker xamarin

我想在工具栏中添加下拉选项选择器..现在我已经添加了这样的标签

<ContentPage.ToolbarItems>
  <ToolbarItem Order="Secondary" Priority="1" Name="Approval V" />  
  <ToolbarItem Order="Primary" Priority="1" Name="sort"/>
</ContentPage.ToolbarItems>
Run Code Online (Sandbox Code Playgroud)

但我找不到任何解决方案将选择器放在这里..请给我一些建议..

Nee*_*ati 5

我找到了它的解决方案,我想分享。如果它可以帮助其他人。

     <ContentPage.ToolbarItems>
    <ToolbarItem Order="Secondary" Priority="1" Name="Approval Now" />
    <ToolbarItem Order="Secondary" Priority="1" Name="Tasks - Future" />
    <ToolbarItem Order="Secondary" Priority="1" Name="Meeting - Future" />
    <ToolbarItem Order="Primary" Priority="1" Name="sort"  Clicked="sort_click" />
  </ContentPage.ToolbarItems>
Run Code Online (Sandbox Code Playgroud)

在 xaml.cs 中

 private async void sort_click(object sender, EventArgs e)
    {
        //string StorageFolder = await Application.Current.MainPage.DisplayActionSheet(SystemMessages.PhothotoSaveFolder, "Cancel", null, SystemMessages.InstallationPhothoto, SystemMessages.SerialNumbers);
        var action = await DisplayActionSheet("Sort Options", "Cancel", null, "By Approval Due Date", "Meeting Date", "Meeting Type");
        Debug.WriteLine("Action: " + action);

    }
Run Code Online (Sandbox Code Playgroud)