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