presented tab controller layout break after changing tab

I am stuck in a very strange auto layout bug. I use Visual studio with xamarin and c#.

If i display a tabController by segue, it works fine. But if i use PresentViewController, the first tab is ok. Then by using the bottom tab bar to change to any tab the auto layout break. It is like no constraint is updated.

to display a viewController i do it in 2 part. First in AppDelegate in finishedlaunching i prepare all my views like this one

airlineVC = this.Storyboard.InstantiateViewController("airLineViewController") as AirLineViewController;

then when i need to display it i use this.PresentViewController(AppDelegate.AirlinesView, true, null); and this.Dismiss(true) to return.

I tried in the viewdidload and subview the function updateconstraint and the updatelayoutifneeded but no success

The other strange thing is if I display a viewcontroller by code and then display a tabController by segway all layout break in the same way.

I tried to manually in the viewdidload and in the viewdidlayoutsubiew but for some reason the height of the top view is 0.

All tab are made in two main part, the top UI and the bottom bar. No constraint use the layoutguide since it is really broken, i use the mainViewEdge

i try to get rid of all segue and manage my view by code for better control and to avoid the storyboard to look like some race track with 8 lines

Also when in landscape mode one of my view have a red warning (i do not need to use that view to get the tab bug) and i found nothing on google, i cant event scroll the error view to see the full thing as you can see in the attached file

Sign In or Register to comment.