xamarin/Xamarin.Forms

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

オープン

#8,422 opened on 2019/11/07

 (4 件のコメント) (3 件のリアクション) (0 人の担当者)C# (1,926 件のフォーク)batch import
e/3 :clock3:help wantedin-progressinactivep/iOS 🍎t/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

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.

コントリビューターガイド