Bug 28500 - [iOS] In-Call Status bar is visible causes incorrect vertical shift
Summary: [iOS] In-Call Status bar is visible causes incorrect vertical shift
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 1.4.1
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-03-27 14:20 UTC by Dennis Smit
Modified: 2017-11-06 22:42 UTC (History)
8 users (show)

Tags: ac, ios, listview, layout
Is this bug a regression?: ---
Last known good build:

Proof of Concept Project (46.50 KB, application/zip)
2015-03-27 14:20 UTC, Dennis Smit
Screenshot after pressing 'Working Nav' option (27.29 KB, image/png)
2015-03-27 14:20 UTC, Dennis Smit
Screenshot after pressing 'Bugged Nav' option (24.92 KB, image/png)
2015-03-27 14:20 UTC, Dennis Smit
Sample project and screenshots illustrating issue (353.65 KB, application/zip)
2015-12-16 15:18 UTC, Roger Peters

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 Dennis Smit 2015-03-27 14:20:05 UTC
Created attachment 10532 [details]
Proof of Concept Project

On a MasterDetailPage the following scenario causes an incorrect upward vertical shift, of the whole application window, when the In-Call Status Bar is visible (Command+Y in simulator):

1. The application uses a ListView as a navigation menu on the Master page (just as in the ModernCRM sample project)
2. The app _directly_ navigates to a new Detail Page from the ListView's ItemTapped or ItemSelected event handler
Presumably not all necessary framework events are handled before the new detail page is loaded. 
Because, when you wrap the ItemTapped/ItemSelected event handler in a BeginInvokeOnMainThread() call, the problem does not occur.

It specifically has something to do with the ListView, replacing the ListView with a Button for navigation, also prevents the problem from occurring.

Proof of Concept Code:

public class App : Application
	public App ()
		Func<string, NavigationPage> page = title => 
			new NavigationPage(new ContentPage { Title = title, Content = new Label { Text = title } })
				{ Title = title, BarBackgroundColor = Color.Gray };

		var listView = new ListView { ItemsSource = new[] { "Working Nav", "Bugged Nav", } };
		var navigationCount = 0;

		listView.ItemTapped += (s, e) =>
			Action navigate = () => ((MasterDetailPage)MainPage).Detail = page(string.Format("NEW PAGE: {0}", navigationCount++)); 

			if (e.Item.ToString() == "Bugged Nav")
			else if (e.Item.ToString() == "Working Nav")

		MainPage = new MasterDetailPage
			Master = new ContentPage
				Title = "MENU",
				Content = listView,
			Detail = page("INITIAL PAGE")
Comment 1 Dennis Smit 2015-03-27 14:20:38 UTC
Created attachment 10533 [details]
Screenshot after pressing 'Working Nav' option
Comment 2 Dennis Smit 2015-03-27 14:20:59 UTC
Created attachment 10534 [details]
Screenshot after pressing 'Bugged Nav' option
Comment 3 Sunil Kumar 2015-05-04 13:51:49 UTC
I have tried to reproduce this issue with the help of attached sample but not able to reproduce. I observed that status bar renders correctly without any vertical shift issue.

Screencast: http://www.screencast.com/t/Uk9htvfN

Please let me know if I missed any thing to reproduce this issue.

Also if possible, could you please provide us ide logs, VSiODesigner log and build info to reproduce this issue at our end.

For ide log,Location: VS-> Help-> Xamarin->Zip Xamarin Logs-> ide.log
For Build info, Location VS-> Help-?> About-> Copy information.
For Designer Log, location: Mac Build Host-> Xamarin.iOS Build Host-> View Build Host log-> Xamarin-> MonoTouchVS-> iOSDesigner-> VSiOSDesiger.log.

Environment info:

Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.51641

Xamarin   3.11.445.0 (5061f92)
Xamarin.Android (d23da369e436488f38c8ab8fe8a9ae7d9ea5256b)
Xamarin.iOS (7741cc495ab0baf04ff0405d0604bc27f0ecae2e)
Comment 4 Roger Peters 2015-12-16 15:18:05 UTC
I'm running into this same issue in Xamarin Forms The screencast does not show the issue as the screencast doesn't show the green ongoing phone call bar at the top. The issue occurs when on a call and that green bar is visible (iOS).

I'm attaching a MasterDetailInCallIssue.zip that has a sample project (one I found on the web) that shows the issue as well as a series of 8 screenshots.  I'll reference the screenshots in the repro steps below.

Steps to reproduce:
1. Run an app with a MasterDetailPage, notice how everything lines up at the top while opening/closing correctly (screen1, screen2)
2. Turn on the in-call status bar (iOS Simulator menu > Hardware > Toggle In-Call Status Bar)
3. Notice how everything shifts down correctly (screen3)
4. Open the drawer (hamburger menu) and pick a menu item
5. Notice how everything shifts up under the call menu as it is not observing the higher status bar height (screen4, screen5)
6. Turn off the in-call status bar
7. Notice how everything stays shifted up, and so now the nav bar is under the iOS status bar, and the drawer menu is higher up (screen6, screen7)
8. Select another menu item from the drawer (now that in-call status is off)
9. Notice how everything shifts back to the correct position (screen8)
Comment 5 Roger Peters 2015-12-16 15:18:58 UTC
Created attachment 14317 [details]
Sample project and screenshots illustrating issue

See note added to issue with repro steps referencing screenshots.
Comment 6 Rui Marinho 2016-04-07 13:43:26 UTC
Ok i can confirm the issue.
Comment 7 Paul DiPietro [MSFT] 2017-11-06 22:42:10 UTC
This no longer appears to be an issue as of the latest stable (2.4.0) build of Forms.