Bug 36135 - Calling SetNeedsLayout for a view does not call the Draw override of the view.
Summary: Calling SetNeedsLayout for a view does not call the Draw override of the view.
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 9.0 (iOS9)
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-11-23 01:09 UTC by Dharmendar
Modified: 2015-11-24 04:16 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Calling SetNeedsLayout for a view does not call the Draw override of the view. (10.73 KB, application/zip)
2015-11-23 01:09 UTC, Dharmendar
Details
Xcode sample (9.77 KB, application/zip)
2015-11-24 04:15 UTC, Rolf Bjarne Kvinge [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Dharmendar 2015-11-23 01:09:02 UTC
Created attachment 13933 [details]
Calling SetNeedsLayout for a view does not call the Draw override of the view.

Calling SetNeedsLayout for a view does not call the Draw override of the view.
But, if I set Background for that custom view and then call SetNeedsLayout, then the Draw override is called.
This was working well for be before, but had got breaked now.

Replication Procedure :
1. Run the attached sample
2. Rotate view, note  Draw override doesn't called, even though i called SetNeedsLayout.
3. Remove commented line in which background is setting randomly, now again run the sample 
4. Note Draw override is called, if I set Background for that custom view
Comment 1 Rolf Bjarne Kvinge [MSFT] 2015-11-23 09:18:02 UTC
The CustomDraw.Draw method is called when I run your sample on an iOS 9.1 iPhone 6s simulator.

In any case this is most likely a difference in newer versions of iOS, and not a bug in Xamarin.iOS, so I suggest trying with older and newer iOS versions to see if you can find out what Apple did.
Comment 2 Dharmendar 2015-11-23 23:30:37 UTC
I could easily replicate this issue even in a simple sample in iOS9 iPhone 6s simulator.

Even I have attached a simple sample for replicating it and have clearly mentioned the my version as iOS 9 in the bug report. 

It is unfair to respond as it is not a bug as I could replicate it in a simple app. I expect a better support from Xamarin. I hope somebody in Xamarin will address this.
Comment 3 Dharmendar 2015-11-23 23:32:08 UTC
In further addition I can also able to reproduce the same issue with the same sample in iOS 8.4 iPhone 6s simulator too. 

Is there any other details that I need to give from my side?
Comment 4 Rolf Bjarne Kvinge [MSFT] 2015-11-24 04:15:32 UTC
Created attachment 13966 [details]
Xcode sample
Comment 5 Rolf Bjarne Kvinge [MSFT] 2015-11-24 04:16:36 UTC
I can reproduce the same behavior in an identical Xcode sample.

This means it's not a bug in Xamarin.iOS, but just how iOS behaves.