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.
Asked
Active
Viewed 46 times
0

rmaddy
- 314,917
- 42
- 532
- 579

Владислав Форафонтов
- 159
- 1
- 2
- 14
-
Try changing the constraint - `Align top to : Safe Area` to `Align top to : View` . – Amit Dec 01 '17 at 11:26
-
if I do like you say, that my button with scrolling stay on top (off-screen), but I want that my button moved with content – Владислав Форафонтов Dec 01 '17 at 11:59
1 Answers
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