This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 53351 - (XF/iOS) PageRenderer of ContentPage is in a TabbedPage's Disappear() method is not called when I change App.MainPage.
Summary: (XF/iOS) PageRenderer of ContentPage is in a TabbedPage's Disappear() method ...
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS (show other bugs)
Version: 2.3.4
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Rui Marinho
URL:
Depends on:
Blocks:
 
Reported: 2017-03-15 12:20 UTC by Bright Lee
Modified: 2017-03-21 18:25 UTC (History)
4 users (show)

See Also:
Tags: AC
Is this bug a regression?: Yes
Last known good build: 2.3.3


Attachments
sample project (31.16 KB, application/zip)
2017-03-15 12:20 UTC, Bright Lee
Details
breakpointbeinghit (250.08 KB, image/png)
2017-03-15 15:51 UTC, Rui Marinho
Details
correct sample project (31.35 KB, application/zip)
2017-03-15 17:13 UTC, Bright Lee
Details

Description Bright Lee 2017-03-15 12:20:51 UTC
Created attachment 20347 [details]
sample project

PageRenderer's Disappear() is not called when ContentPage is in a TabbedPage.
It is not called when I change App.MainPage on forms.

This causes many problems because we do unregister observers in ViewWillDisappear.
If this renderer method's not called, there is no way to unregister observer.

attached sample project reproduces it.


tested XF ver : 2.3.4-pre5

It worked fine on 2.3.3.193.
Comment 1 Rui Marinho 2017-03-15 15:36:29 UTC
This works fine for me with your repo. 

Can you give me what versions of Xamarin you have? 

thanks
Comment 2 Rui Marinho 2017-03-15 15:51:56 UTC
Created attachment 20357 [details]
breakpointbeinghit
Comment 3 Bright Lee 2017-03-15 17:13:28 UTC
Created attachment 20363 [details]
correct sample project

Hi, 
I'm sorry to attach wrong sample project. 

The contentpage should be inside Navigation.

To reproduce..
1. select second tab named "nav"
2. press the button.

Both ViewWillDisappear and ViewDidDisappear are not called
Comment 4 Bright Lee 2017-03-15 17:13:58 UTC
I attached new sample project again. 
Please look this.

Thanks.
Comment 5 Bright Lee 2017-03-15 17:17:32 UTC
Comment on attachment 20347 [details]
sample project

This prev project does not reproduce the issue.

Please try my new attachment project.
Comment 6 Rui Marinho 2017-03-17 12:55:35 UTC
Hey Bright Lee, can you try override dispose and see if it works for you on the custom renderer ? 

The thing is to fix a memory leak we are disposing the custom renderer first and that's why you don't get the override being called. We do RemoveFromSuperView first, but it seems it doesn't call ViewDidDisappear .
Comment 7 Bright Lee 2017-03-17 13:05:29 UTC
If you ask me if I can or not, I'll say yes and no problem. 
I checked it and works fine.

But I can not say anything if it's right.
At least I'm afraid this changes will be a problem on other companies' app as well.

Especially if they've been unregistering an observer in OnDisappear().
Comment 8 Samantha Houts 2017-03-21 18:25:56 UTC
@Bright Lee: Thank you for your feedback. We agree that this is a behavioral change that may affect other users. We will include a warning note on the 2.3.4 release notes.

Note You need to log in before you can comment on or make changes to this bug.