10 Replies
      Latest reply on Jun 19, 2019 10:21 PM by DogRider
      DogRider Level 1 Level 1 (0 points)

        I'm making an app that's in landscape only. I set a stack view's horizontal center to be the same as the safe area's leading, and then I set the multiplier to 2 in order to push the stack view to the right. On devices with notches (such as iPhone Xs or iPhone Xs Max), this constraint works perfectly as I intended. But all the notch-less devices (such as iPhone 8 plus and iPhone 8) ignore the multiplier setting. In other words, on notch-less devices, the stack view's center is always exactly equal to the safe area's leading, even if I set the multipler to numbers that are greater than 1.

         

        Why does the multiplier only works on devices with the notch but not on notchless devices? And is there a way I can get the multiplier to work on notchless devices too?

        • Re: Multiplier doesn't work on notchless devicess
          Claude31 Level 8 Level 8 (6,135 points)

          Not sure to understand:

          I set a stack view's horizontal center to be the same as the safe area's leading

          So, stackView left part will not be visible ?

          Do you mean

          I set a stack view's horizontal center to be the same as the safe area's centerX ?

           

          What is the constant defined in the constraint ?

           

          I tested (on simulator), with center of a label aligned with center of safe area, with multiplier 2 and constant value 0.

          It works as expected.

          Tested with a horizontal stackView ; works as well, on both iPhone Xs and iPhone 8 (always on simulator).

           

          I also tested with center of a stackView aligned with leading of safe area, with multiplier 2 and constant value 0.

          Works correctly on both devices.

           

          So, you may have defined other constraints that create problem.