Bug 38020 - Storyboard content are partially hidden to left and top
Summary: Storyboard content are partially hidden to left and top
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS Designer ()
Version: 4.0.0 (C6)
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Alan McGovern
URL:
: 37196 38216 ()
Depends on:
Blocks:
 
Reported: 2016-01-26 05:48 UTC by Prashant Cholachagudda
Modified: 2016-02-01 11:34 UTC (History)
6 users (show)

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

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 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 FIXED

Description Prashant Cholachagudda 2016-01-26 05:48:09 UTC
Storyboard contents are offset to left and top when rendered in the VS and XS

# Steps to reproduce 
1. Open the attached storyboard in Xamarin/Visual Studio.
2. Notice the UI controls are partially hidden

However, storyboard is rendered correctly when opened in XCode and on the device

If we comment out line 17 in the file, designer is rendered correctly.
Line 17: <segue destination="10" kind="relationship"
relationship="rootViewController" id="9"/>

Storyboard attached in private comment
Comment 2 xamarin-release-manager 2016-01-29 13:15:09 UTC
Fixed in version 99.0.0.1175 (master)

Author: Alan McGovern
Commit: d6b514a8296f3eb46c3b613707325ef7442e5e09 (xamarin/md-addins)
Included in Commit: 5558e210a111d2a23c19eed58ee17cef6edafb4a (xamarin/XamarinVS)
Comment 3 Alan McGovern 2016-01-29 13:15:20 UTC
The underlying cause of this is the existence of the `translatesAutoresizingMaskIntoConstraints="NO"` attribute in the top level UIView in some of the ViewControllers.

For example these four places:
 <view key="view" opaque="NO" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="21" customClass="GradientView">

<view key="view" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4224" customClass="GradientView">

<view key="view" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7617" customClass="GradientView">

<view key="view" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9563" customClass="GradientView">

You can work around the problem by just removing the `translatesAutoresizingMaskIntoConstraints="NO"` string. Both Xcode and iOS itself ignore this attribute if it is set, which means the top level view will always have `TranslatesAutoresizingMaskIntoConstraints` set to `true`. The fix on our side was to do the same.

Out of interest, can you remember anything special about how those 4 views were added which could've triggered `translatesAutoresizingMaskIntoConstraints="NO"` to be written to the xml? I presume it was our designer that did that and not Xcode. If you have a reliable way to make that attribute appear in the toplevel 'view' in a viewcontroller, i'd love to know.
Comment 5 Alan McGovern 2016-01-29 13:53:05 UTC
*** Bug 37196 has been marked as a duplicate of this bug. ***
Comment 6 Alan McGovern 2016-02-01 11:34:09 UTC
*** Bug 38216 has been marked as a duplicate of this bug. ***