-2

Two image view 1.background 2.a character image

This is the background image with size 1366*1024-1x,2732*2048-2x

This is the constraints i given to the background image.

second image view with height-160*491-1x

Constraint given the second image.leading,bottom of 75

Here i given the constraints for height.

Here i edit the height with multiplier 1:2 to the second image

Here i set the aspect ratio and update the frame .This al set in 12.9 iPad screen size.

after adding this constraints.In the 9.7 the location of the character is moved up.That means i was placed on the brown colour line(shoes of the character is in brown line)But in the 9.7 the character moved that means in the screen shot the shoes moved up.

how to resolve it.I need to place the character on that position.

julie
  • 1
  • 3
  • Wow.. for anyone else trying to figure out this question, the character is standing on the green (olive green) strip in the first image.. but the character is not standing on the strip in the second image.. I was legit looking for a green border and could NOT see the difference between the two images.. @OP: Hold Control key, click the first image.. drag the cursor to the second image and let go.. Now you can choose "Bottom" constraint and set an offset. – Brandon Jan 20 '18 at 04:04
  • I don't understand the issue enough to figure out how to fix it. All I know is that you constrained one image to another and "somehow" the second one moves.. – Brandon Jan 20 '18 at 04:30
  • @julie Check this [vary-for-traits](https://stackoverflow.com/questions/39890055/what-is-vary-for-traits-in-xcode-8), you may get better tutorials over internet to learn. vary-for-traits is used to give different contrants to different classes , hopefully it will solve your issue, if still having any issue then ask freely. – dahiya_boy Jan 20 '18 at 05:17
  • @dahiya_boy i have edited the question.i have given the screen shot above.please check.how to reslove it – julie Jan 20 '18 at 06:16
  • @julie Can you send me dummy project with this screen only? – dahiya_boy Jan 20 '18 at 06:59
  • @julie Got it, give me time to check. – dahiya_boy Jan 20 '18 at 07:36
  • @dahiya_boy how to make the width and height of the character look same in 12.9 and 9.7.That means ,how to make the image small in 9.7 after setting in 12.9 – julie Jan 22 '18 at 05:38

1 Answers1

0

Follow this if you ever faced this issue.

  1. Try to do with Vary for traits.

  2. Now when you'r adding constraints within same size classes and you wanted different constraints like as you mentioned here then.

    • Give the simple consraints.
    • Take the outlet of constraints the you wanted to change.
    • Now put the condition device wise or orientation wise in your code work and change the constraint's value.

If something unclear then let me know.

dahiya_boy
  • 9,298
  • 1
  • 30
  • 51