简体   繁体   中英

Constraints with Label on Image View

In my app I have a Image for my background with labels on top of it that are not moving correctly on the iPhone 6 Plus. I am having trouble with the constraints to make the labels move correctly with the image. With the screenshot I attached what constraints should each label have to keep it aligned with the image? Thank you! screenshot

this shows the suggested constraints constraints

Your constraints aim on left alignment. So that's way it only works on the size that you were building on, and other display sizes are not aligned properly.

Try to, at least these:

  1. add left leading constraint between superview and textField
  2. add right trailing constraint between button and superview
  3. add spacing constraint between textfield and button
  4. set exact width constraint of your button. ... then add suggested constraint or add your own to them.

Like this (iPhone 6):

在此处输入图片说明

View as iPhone 6 Plus:

在此处输入图片说明

View as iPad Portrait:

在此处输入图片说明

... etc

Is that exactly what you asked?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM