0

I met this problem and can't solve it. I want that my cancel-button will consolidate from top screen on 20px, but on iPhone X screen it's more than 20. What I want photo. Important: my button make moving with my scroll and to be from top 20px already. My constraints: - Align top to: Safe Area; Trailling space to: Superview; Width equalls: 43.

rmaddy
  • 314,917
  • 42
  • 532
  • 579

1 Answers1

0

You can go with two approach which ever suits in your scenario :

1) Write code according to the device :

Add an IBOutlet for Align top to : Safe Area constraint of button and increase decrease the yourHeightConstraintOutlet.constant according to the device.

Below link will help you to write device specific code:

2) You can change the Align top to : Safe Area constraint of scrollView to Align top to : View

Amit
  • 4,837
  • 5
  • 31
  • 46