Xamarin.forms: [Bug] ToolbarItem Order property ignored

Created on 8 May 2019  路  24Comments  路  Source: xamarin/Xamarin.Forms

Description

Then Order property of ToolbarItem is totally ignored, the item is always displayed as primary even when set to secondary

Steps to Reproduce

  1. Create a new XF project using the Shell template
  2. On a ContentPage add ToolbarItem and set Order to secondary
  3. Run on Android device

Expected Behavior

Items with order set to primary show on navigation bar while items with order set to secondary shows as a pop up menu when the 3-dots icon is tapped

Actual Behavior

All ToolbarItem show up on the Navigation bar regardless of their order settings, the 3-dots icon don't even show

Basic Information

  • Version with issue: Xamarin.Forms 4.0.0.394984-pre10
  • IDE: Visual Studio Community 2019
shell 3 high impact Android bug

Most helpful comment

@iooovolts @Darlingtone I think the fix in my PR has just missed the release that just came out. Please be on a lookout for the next 4.2 or 4.3-pre release which should include it for sure.

All 24 comments

Would you mind attaching a zipped reproduction?

Here is a GitHub repo XamToolbarDemo

This is a just the default VS 2019 Xamarin.Forms App template I only added more Toolbar items and set their Order property to Secondary

Tested on actual device Tecno F1 Android 8.1.0

Experienced the same behaviour.

I'm experiencing the same behavior on Android & iOS.

VS 2019
XF 4.0.0.482894

same with
XF 4.1.0.496342-pre2

same issue i have.
in XF 4.1

Annotation 2019-07-12 184004

Experiencing the same
screenshot-1566484382764

Same with XF 4.2.0.709249

image

Issue come when used shell.

Same issue here with 4.2.0.778463. This is blocking my intended migration from Master-Detail to Shell.

@samhouts: I don't suppose there are any workarounds for this?

I'm afraid I'm not aware of any workarounds at this time. @PureWeen ?

The error originates here. The Order simply is not taken into account.

I've opened a PR to fix that

@jfversluis: greatly appreciated!

One question, while you're in the area: I probably should have filed an issue for this, but when I was evaluating porting over to Shell, I noticed that ToolbarItems from sub-pages inside a TabbedPage weren't being picked up by the Shell at all. Is that by design, or does it also need to be fixed?

(I can provide a repro if needed.)

@mfeingol that's what we do it for! 馃槈

For the other thing, if you wouldn't mind opening a new issue (with a reproduction would be superduper awesome) please do. That way we can track the two things separate from each other. From the top of my head I'm not sure if that is by design (@PureWeen ?) but my gut feeling says it's not and it should just work as it does on non-Shell apps

So you have TabbedPage inside of your Shell?

@PureWeen: I was moving my existing app into the Shell, and the existing app has TabbedPages, so... yes.

Once it's clear that Shell doesn't have any showstoppers, then I'll put some work into porting tabs over to the way Shell does them. One complication is my viewmodels are shared with a native UWP app where the separate tabs are not separate pages, so there's a little bit of entanglement between tabbed pages. But it's just work.

In any case, this is why I was asking whether it was by design or not... I expected it to just work, but I can see why you'd say "well, TabbedPage is deprecated and shouldn't be used with Shell".

Yea it's definitely by design. If you could log an issue with your use case then we (or someone from the community) can look into making things like that work with Shell

The problem is that getting those inner pages to work with Shell starts to add layers of complexity we'd like to avoid. So ideally we could just get you full Shell

That's what I thought. I'll file an issue so you have it in mind, but no surprises if it gets closed as WF. :-)

@samhouts I'm still experiencing the same issue. Do I need to perform some special action? I've already tried cleaning the solution.

I can see https://github.com/xamarin/Xamarin.Forms/pull/7718 has been completed with UI test passed. I have updated to XF 4.2.0.815419. Is there anything I am missing? Or has the fix simply not yet been rolled out?

Just update to XF 4.2.0.848062 released 2nd of Oct. 2019 issue not yet fixed. also tried the lasted 4.3-preview no luck

@iooovolts @Darlingtone I think the fix in my PR has just missed the release that just came out. Please be on a lookout for the next 4.2 or 4.3-pre release which should include it for sure.

Since 4.3.0.908675 it is fixed for Android, but not for IOS.
ToolbarItems always appear as primary even if configered as secondary.

@KoenMat it seems you are totally right. Since this was focussed on Android I didn't pay any attention to iOS. I've opened a new issue for it to track it properly.

Was this page helpful?
0 / 5 - 0 ratings