3 Replies
      Latest reply on Aug 22, 2019 8:14 AM by elementarteilchen
      Devgeek Level 1 Level 1 (0 points)
        I made a sample project to show difference in Storyboard rendering of UIStackView in XCode 11 beta vs XCode 10.3. Attached are screenshots for both the versions of project. Can someone tell me whats going on in XCode 11 beta and how do I correct it? The output is same if I build and run the program on device or Simulator. But I want to fix the rendering in Storyboard.

         

        Here is screenshot from XCode 10.3

         

        https://i.stack.imgur.com/3KqGH.png

         

        And here is how the same storyboard gets rendered in XCode 11 beta:

         

        https://i.stack.imgur.com/f4ihG.png

         

        This is the simplest sample and if I insert more autolayout constraints, XCode 11 simply distorts the UIButton images in UIStackView. In my real project, it's impossible to even work on Storyboard due to extra large images, some of which are even distorted/squeezed.

         

        Has anyone found a solution to this issue? I already filed a bug but wondering if I am doing something wrong that can be fixed.

        • Re: XCode 11 beta 5 Storyboard distorted images in UIStackView
          Claude31 Level 8 Level 8 (6,515 points)

          That's surprising, as settings seem exactly the same.

           

          Could you however screenshot the different settings and constraints for each of the objects in stackView ?

          • Re: XCode 11 beta 5 Storyboard distorted images in UIStackView
            elementarteilchen Level 2 Level 2 (25 points)

            I do see the same issue in one of my projects. In the real App, the images are shown correct, but in Interface Builder everything is a complete mess. I think this issue affects all images within UIButton and UIBarButton objects and its not related to StackViews (I do not use thes in my project). It's almost impossible to work with this mess. However for UIImageView elements the images look fine.

             

            Another issue I see in this project: The default disclosure indicator icon of TableViewCells is also larger(!) and distorted than normal. This is not visible in Interface Builder, but it's visible in the App itself on the device. Though only in this project. I do not see this in other projects, though in these the TableViewCells are created by code, and not via Storyboard.

             

             

            Even worse, Interface builder of the new XCode 11 Beta  also messes up the overall layout of many but not all items (I haven't reall yound a pattern which indicate when this happens and when not). So for example labels which were defines with a certain width in older Interface Builder releases do get a much larger width in the new XCode 11, destroying the layout. This special project doesn't use autolayout yet, because its layout is so simple that the old properties flexible width/height/left/right/upper/lower margins are all I need. Even if I correct the sizes in the new Interface Builder the rectangle that shows the boundaries of an object is shown correct, but the "content" (like the text of a lable) is still shown with the wrong boundaries in Interface builder (so it goes beyond the boundary rectangle).

             

            I guess with autolayout this XCode bug is not such a big issue, because autolayout will later correct the messed up layout at run time. Though of course while woring on the layout in Interface builder this is nevertheless an issue, if so much is totally messed up.

             

            In general the new Interface builder of XCode 11 is still far too buggy to use it right now. Simply opening a story oard from an older XCode release can seriously messup the user interface and break an App.