xamarin/Xamarin.Forms

[Bug] [iOS] Secondary ToolbarItems are added to regular Toolbar instead a secondary Toolbar

Aberta

#8.422 aberto em 7 de nov. de 2019

 (4 comentários) (3 reações) (0 responsável)C# (1.926 forks)batch import
e/3 :clock3:help wantedin-progressinactivep/iOS 🍎t/bug :bug:up-for-grabs

Métricas do repositório

Stars
 (5.644 estrelas)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

Description

Bug is on iOS only. Traditionally, XF creates a secondary Toolbar to render ToolbarItems marked as "Secondary". When using Shell, XF does not create the seondary Toolbar, it adds all ToolbarItems to the main Toolbar.

Steps to Reproduce

  1. Create a new Shell project. When using the standard template, the created Pages and ViewModels can be removed. Only one Page is needed.
  2. Add a ContentPage (i.e. MainPage) if you deleted all pages.
  3. Add a toolbar Item with Order "Primary" and one with Order "Secondary"
  4. Add one Flyout Item with a ShellContent to the AppShell. Use MainPage for this ShellContent as DataTemplate.

or as I did:

  1. Take the official Xamarin.Forms samples
  2. Add an AppShell.xaml and AppShell.xaml.cs
  3. Assign AppShell instance as MainPage in App.xaml.cs
  4. Define MainPage as FlyoutItem/ShellContent in AppShell.xaml

Runtime:

  1. Start App
  2. Go to the page with the Toolbar Items

Expected Behavior

The ToolbarItem with Order Primary is shown in Toolbar. The ToolbarItem with Order Secondary is shown in a Secondard Toolbar below the regular Toolbar

Actual Behavior

ToolbarItem with Order Primary and Secondary are shown in the regular Toolbar. No secondard Toolbar is shown.

Basic Information

  • Version with issue: 4.2.0.709249 / 4.3.0.947036
  • Last known good version: n/a
  • IDE: Visual Studio 2019 (16.3.8)
  • Platform Target Frameworks:
    • iOS: XCode 11.1 (cannot update to XCode 11.2, update crashes for whatever reason), iOS 12.0, 12.4
    • Device: Simulator with iOS 12.0 and iPhone 6 Plus with 12.4.1

Screenshots

Secondary Toolbar without using Shell:

ShellSecondaryToolbarIssue-OK

Toolbar with using Shell: ShellSecondaryToolbarIssue-with-Shell-NOK

Reproduction Link

ToolbarItemDemos with Shell.zip

Recommendations for alternative?

Any recommendations for a nice alternative are very welcome as well.

Guia do colaborador