Bug 59736 - DialogViewController Height Calculating Issue & Gap Between Sections.
Summary: DialogViewController Height Calculating Issue & Gap Between Sections.
Alias: None
Product: iOS
Classification: Xamarin
Component: MonoTouch.Dialog ()
Version: XI 11.2 (d15-4)
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: 15.5
Assignee: Bugzilla
Depends on:
Reported: 2017-09-25 23:40 UTC by Hooman Yazdi
Modified: 2018-02-05 16:30 UTC (History)
4 users (show)

Is this bug a regression?: No
Last known good build: 10.14

Is the Sample that shows the issue (12.22 KB, application/x-zip-compressed)
2017-09-25 23:40 UTC, Hooman Yazdi
Difference Between Old and New (62.40 KB, image/png)
2017-09-26 01:17 UTC, Hooman Yazdi

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:

Description Hooman Yazdi 2017-09-25 23:40:24 UTC
Created attachment 24928 [details]
Is the Sample that shows the issue

There seems to be some issues in DialogViewController for calculating the Cell height. Specially the height of group header.  It started after recent update to Xamarin, MonoTouch...  The same App which compiled few weeks ago is working properly and objects are being displayed properly.

I have attached a simple project that shows the issue.  As you see the Test ViewController has 3 sections.


1. For some reason, there is a gap between sections.  In older versions, they were more closed together.
2. When Insert a section to the Root, it puts a big gap between that and next Section.
Comment 1 Timothy Risi 2017-09-26 01:06:23 UTC
I'm seeing the same thing when running on XI 11 vs 10.14
Comment 2 Hooman Yazdi 2017-09-26 01:16:34 UTC
It's definitely different.  I have attached an image from real app that shows the difference between old one and new one.
Comment 3 Hooman Yazdi 2017-09-26 01:17:19 UTC
Created attachment 24929 [details]
Difference Between Old and New
Comment 4 Timothy Risi 2017-09-26 01:18:08 UTC
Sorry, I worded my comment badly. I meant I’m seeing the same issue
Comment 5 Hooman Yazdi 2017-09-26 01:21:49 UTC
Thanks a lot Timothy, Any idea what could be the issue and how long it will take to fix?
Comment 6 Sebastien Pouliot 2017-09-26 02:30:12 UTC
This is not a bug, nor a regression. 

Beside the fact that MonoTouch.Dialog.dll (MTD) has been unchanged (for a few releases now) you can easily duplicate this by:

Using XI 11.0 (stable) and

1. run the attached sample on an iPhone 7, iOS 10.1, simulator

2. run the attached sample on an iPhone 7, iOS 11, simulator

You'll notice that the same application binary gives visually different UI. Why ?

Because Apple adjust their visual between iOS versions, e.g. font updates, constants (like this one)... and MTD, being a layer above UITableView, keeps the OS defaults.

If you need a specific layout across versions then you better use a layout system (either auto layout or Xamarin.Forms layout) that will be more consistent.

You can read about some of the changes in blog posts like
Comment 7 Hooman Yazdi 2017-09-26 03:25:02 UTC
Thanks for your quick answer.  Is there any way of setting this to work like iOS 10 for MTD?
Comment 8 Hooman Yazdi 2017-09-26 14:09:43 UTC
The Screenshot that I sent earlier is based on iOS 11.   It shows the result of 2 Apps both in iOS 11.

One of them compiled few weeks ago with SDK 10 and one compiled yesterday with SDK 11.  But they are both running on iOS 11

As screenshot shows, they are different.

If you still believe this is not an issue, Is there any way of setting this to work like iOS 10 for MTD when compiling with SDK 11?
Comment 9 Sebastien Pouliot 2017-09-26 15:44:12 UTC
That's how Apple works. 

* build SDK 11, run iOS10 -> iOS 10 does not know about new API/constants (from iOS 11) and your UI should remain unchanged;

* build SDK 10, run iOS11 -> iOS 11 tries to mimic iOS 10 (so existing App Store applications are not affected). This is not always 100% identical to the previous one but it means that existing applications (compiled with earlier SDK) keeps their behaviour (so stuff from the App Store remains unaffected).

By extension it means that as long as you continue building with Xcode 8.3 then you'll retain the older behaviour. Note that at some point (it varies with each release) Apple will require the usage of the new (stable) Xcode and you won't be able to submit updates. 

* build SDK 11, run iOS11 -> new UI rules applies. Apple's goal is to make sure you review your UI when you resubmit your application with a new iOS SDK.

> Is there any way of setting this to work like iOS 10 for MTD when compiling with SDK 11?

Like I mentioned before if you want exact control over your UI you need to define them with using a layout engine (like auto layout or a library that provides it's own, e.g. Xamarin.Forms). If you use UITableView (or a thin-layer above it, like MTD) then you are subject to Apple rule changes on new SDK releases.

You might want to to tweak the UITableView properties to match iOS 10 behaviour, see [1] and [2]. However you're entering a uphill battle with Apple as those changes will keep coming up with newer SDK releases. I strongly suggest you to use a layout system if an exact look of your UI is needed across versions.

[1] https://developer.xamarin.com/guides/ios/platform_features/introduction-to-ios11/updating-your-app/#Table_View

[2] https://stackoverflow.com/q/46339344/220643
Comment 10 Dennis Welu 2018-02-05 16:30:12 UTC
Connecting to related workaround: https://forums.xamarin.com/discussion/104559/monotouch-dialog-on-ios-11-table-spacing