xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

Android: Master Navigation page displayed as third bottom tabbar item #9143

Open alekseevabah opened 4 years ago

alekseevabah commented 4 years ago

Description

We have the following pages structure: MainPage = MasterDetailPage:

Toolbar placement is set to Bottom for Android.

Steps to Reproduce

Run the attached test project on android device.

Expected Behavior

Third bottom tabbar item is displayed similar to other tabbar items. Master page is accessible via the hamburger icon.

Actual Behavior

Master page is displayed instead of third bottom tabbar item. Master page is not displayed when tapping on the hamburger icon.

Basic Information

Screenshots

Screenshot_20200120-173631 Screenshot_20200120-173639

Reproduction Link

AppWithMenuInsteadOfTabbedItem.zip

Notes

Looks like the issue was introduced with this pull request: https://github.com/xamarin/Xamarin.Forms/pull/6471 (we reverted this file and the bottom tabbar behaved correctly). Using random numbers as Ids for MasterDetailContainer also solves the issue (looks like Master navigation page gets the same ID assigned as third bottom tabbar item?).

PureWeen commented 4 years ago

@kvpt

kvpt commented 4 years ago

I use this code in my apps for more than 6 months, but I don't use bottom bar. I will look at it, thanks for the reproduction. I will add an UI test at the same time as the fix.

kvpt commented 4 years ago

@alekseevabah You was right, the issue is caused because BottomNavigationItem id was set manually in a for loop. So the GeneratedViewId of the MasterDetailPageContainer was the same. But why it's working in all others cases and not this one 🤷‍♂.