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

<ContentPage.ToolbarItems>
  <ToolbarItem Order="Secondary" Priority="1" Name="Approval V" />
  <ToolbarItem Order="Primary" Priority="1" Name="sort"/>
</ContentPage.ToolbarItems>

但我在这里找不到任何解决方案,请给我一些建议。

最佳答案

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

     <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>


在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);

    }

09-28 09:33