Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
If an iOS project doesn't have any launch images defined, UIScreen.MainScreen.Bounds will always return a height and width of 480 and 320, respectively. I was able to reproduce this by removing the launch images from the FormGallery example project.
Where did you find the FormGallery example project?
I tried creating a new project from a template, and UIScreen.MainScreen.Bounds worked fine without any launch images.
Created attachment 7368 [details]
Bounds with launch image
Created attachment 7369 [details]
Bounds without launch image
Created attachment 7370 [details]
iOS simulator screen shot with launch image
Created attachment 7371 [details]
iOS simulator screen shot without launch image
I got the example from the GitHub site (https://github.com/xamarin/xamarin-forms-samples).
And I apologize, left of the key detail that this is an issue when running an iOS app in the Retina 4-inch simulator or deploying it to a similar device.
Attached are screen shots of the simulator and bound reported in Visual Studio's debugger with and without the launch screen defined when run against the Retina 4-inch simulator. In the simulator screen shot without the launch image defined, there are back bands at the top and the bottom. The debugger says the bounds are that of the 3-inch iOS simulator. When the launch image is defined, the app fills the full screen of the simulator and the height on the bounds is correctly being reported.
The presence or not of the launch image is how Apple decided to determine if you're compatible with 4 inch devices or not.
Here's a bit more information: http://redth.codes/get-your-monotouch-apps-ready-for-iphone-5-today/
In short: if you don't have the launch image, iOS will think your app doesn't know about the 4 inch size, and will tell your app the screen is 3.5 inches.