Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

iOS - Icon in Detail of MasterDetail wrong after rotation #4506

Open
Sauder91 opened this issue Nov 21, 2018 · 4 comments
Open

iOS - Icon in Detail of MasterDetail wrong after rotation #4506

Sauder91 opened this issue Nov 21, 2018 · 4 comments
Labels
e/3 🕒 3 help wanted We welcome community contributions to any issue, but these might be a good place to start! i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often inactive Issue is older than 6 months and needs to be retested p/iOS 🍎 t/bug 🐛 up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!

Comments

@Sauder91
Copy link

Description

We have a MasterDetailPage that is set to SplitOnLandscape. The detail page is a navigation page. If we add a page to the detail navigation stack, rotate the device, then use the back arrow in the detail page the icon in the detail is off. If you off in landscape, upon rotation to portrait and going back the icon will be gone entirely. if you started in portrait upon rotation and going back a hamburger icon will appear.

Steps to Reproduce

  1. Create MasterDetailPage with navigation page in detail
  2. push new page in detail navigation page
  3. rotate the device and go back.

Expected Behavior

No icon should be visible when in landscape and a Hamburger should be available in portrait

Actual Behavior

No icon in portrait and hamburger in landscape

Screenshots

image from ios

@rmarinho rmarinho added p/iOS 🍎 s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Nov 22, 2018
@rmarinho
Copy link
Member

HI @Sauder91 what version of Forms are you using and iOS btw?
Do you mind upload a small reproduction example, I m not being able to reproduce your issue with latest stable.
Seems I only see the mdp icon when in Portrait as It should.

@PureWeen
Copy link
Contributor

PureWeen commented Jan 2, 2019

Closing for now. If you can provide a test project then we can reopen.

@PureWeen PureWeen closed this as completed Jan 2, 2019
@dbard
Copy link

dbard commented Jul 9, 2019

I've been working on this issue with Sauder91. Please reopen this issue.

Attached is a sample project. It was created using the Master-Detail Forms App template through File, New Solution. The only change in source from the default project created was to change MasterBehavior from Popover to SplitOnLandscape on line 22 in MainPage.xaml.cs.
That line now: MasterBehavior = MasterBehavior.SplitOnLandscape;

Happy to provide a video with commentary showing the problem. Just ask, it's very easy to reproduce. In testing this, I also found a way to cause a crash, which I've also put below, so there are two issues here, but I'm guessing their are inter-related enough I'll let you know if you'd like me to open an issue just for the crash.

Sauder91 mentioned the hamburger icon. Our app uses that image set through IconImageSource, instead of the string "Menu" on the button. I did not include it in the attached project and the behavior was the same and I wanted to provide something to you with minimal changes if you want to create a test project yourself. If needed for your testing, I added the image file to iOS resources and added IconImageSource set to it into the ContentPage properties on line 2 of MenuPage.xaml.

Most of issues occur in iOS and the issue happens the same on the Simulator as on an actual device and I'm using the latest Xamarin.Forms (4.1.0.581479). I added Android comments at the bottom.

Issue summary:

The visibility state of the Menu (or a hamburger icon) doesn't update when a detail view is pushed, then rotated, then popped.

Steps to Reproduce:

From Portrait

  1. Launch app in Portrait (Menu is visible)
  2. Tap any item in the listview (bringing up detail view and now <Browse to go back)
  3. Rotate to landscape
  4. Tap <Browse
  5. Menu will be visible, but shouldn't be (but it was visible at the beginning of step 2)

Three ways to fix this and make Menu disappear:

  1. Rotate to portrait, then back to landscape, OR
  2. Tap it, OR
  3. Select another item from the menu

From Landscape

  1. Launch app in Landscape (note Menu is not visible)
  2. Tap any item in the listview (bringing up detail view and now <Browse to go back)
  3. Rotate to portrait
  4. Tap <Browse
  5. Menu will not be visible, but should be (it wasn't at the beginning of step 2 either)

One way to fix the issue:

  1. Rotate to landscape, then back to portrait

Now crash the app:
Tap Menu. I get: SystemInvalidOperationException / Can't change IsPresented when setting SplitOnLandscape.

And I have one more hint...this crash will only happen if the app was launched in landscape. If I launch in portrait, rotate to landscape and then go through the "From Landscape" steps above, tapping on Menu will work as expected and not crash the app. Only if it wasn't there before the push/rotate/pop sequence does it crash when tapped.

Android:

From Portrait:

  1. Launch app in Portrait
  2. Tap any item in thelistview
  3. Rotate to landscape
  4. NO detail screen and NO Back button (on the menu - the device's back button works)

From Landscape:
No issues observed. No crash on the Menu button.

masterdetail.zip

@dbard
Copy link

dbard commented Jul 11, 2019

Hi @PureWeen, @samhouts and @rmarinho - sorry if this violates protocol for requesting this be reopened. I didn't see any activity on the above after a couple days so thought I'd call attention to this.

Please let me know what I should do have have this looked at again. Reproducible case and sample project is in the post above.

Thanks.

@samhouts samhouts reopened this Jul 11, 2019
@samhouts samhouts added s/unverified New report that has yet to be verified t/bug 🐛 labels Jul 11, 2019
@samhouts samhouts added i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often e/3 🕒 3 and removed s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. s/unverified New report that has yet to be verified labels Jul 11, 2019
@samhouts samhouts added inactive Issue is older than 6 months and needs to be retested help wanted We welcome community contributions to any issue, but these might be a good place to start! up-for-grabs We welcome community contributions to any issue, but these might be a good place to start! labels Jan 7, 2020
@samhouts samhouts added this to the 5.0.0 milestone Aug 13, 2020
@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
e/3 🕒 3 help wanted We welcome community contributions to any issue, but these might be a good place to start! i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often inactive Issue is older than 6 months and needs to be retested p/iOS 🍎 t/bug 🐛 up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!
Projects
None yet
Development

No branches or pull requests

5 participants